diff --git a/build.sh b/build.sh index 899de56..ac04bf5 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,4 @@ gcc tests/test.c src/lina.c -o test -Wall -Wextra -g -Isrc/ gcc tests/test_loader.c src/lina.c -o test_loader -Wall -Wextra -g -Isrc/ + +gcc tests/my_test.c src/lina.c -o my_test -Wall -Wextra -g -Isrc/ diff --git a/my_test b/my_test new file mode 100755 index 0000000..01f6c07 Binary files /dev/null and b/my_test differ diff --git a/tests/my_test.c b/tests/my_test.c new file mode 100644 index 0000000..815784b --- /dev/null +++ b/tests/my_test.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include "lina.h" + +#define check assert + +//Print the matrix A with size m by n +static void pmatrix(FILE *fp, double *A, int m, int n); + + + +int main() +{ + int n,m; + double *M; + char *msg; + + + FILE *ptr = fopen("tests/dot/t1.txt","r"); + check(ptr != NULL); + + M = lina_loadMatrixFromStream(ptr, &n, &m, &msg); + + printf("%d, %d", m,n); + //pmatrix(stdout,M,m,n); + + free(M); + fclose(ptr); + return 0; +} + +static void pmatrix(FILE *fp, double *A,int m,int n){ + + for(int i = 0; i