diff --git a/README.md b/README.md index ef214cb3208618d9546d9aac2028f5ed3856a596..eb890028b63bd8e1ce0983f1ae38fe43c4c788e3 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,8 @@ Use this command to compile the project. > `make clean` Use this command to clean the project. + +### Run the tests +> `make run_tests` + +Use this command to start the tests. \ No newline at end of file diff --git a/main.c b/main.c index bf04085420f06083131721016f75981992ed1eb6..ba4f4186dfe22c877ccc06cb5eb6ad71da627058 100644 --- a/main.c +++ b/main.c @@ -18,6 +18,7 @@ int main() { matrix_init(&mat, m, n, val); printf("Empty matrix %dx%d\n", m, n); matrix_print(mat); + matrix_destroy(&mat); // Init from array matrix_init_from_array(&mat, m, n, data, s); printf("Matrix %dx%d from array\n", m, n); diff --git a/makefile b/makefile index 07e07fb52c8a2d771c7e8bf0c2f7cf18096a49ca..27ba3fee560d5993be5c10b83deabf470c9538f4 100644 --- a/makefile +++ b/makefile @@ -1,12 +1,12 @@ LIB=-lm CC=gcc -Wall -Wextra -g -run_tests: tests - ./$< - matrix: matrix.o main.o $(CC) $^ -fsanitize=address -fsanitize=leak -o $@ $(LIB) +run_tests: tests + ./$< + tests: test.o matrix.o $(CC) $^ -fsanitize=address -fsanitize=leak -o $@ $(LIB)