Restructured and renamed some tests.

This commit is contained in:
2023-09-03 13:52:45 +02:00
parent f052fd8a94
commit 3543700b01
6 changed files with 89 additions and 74 deletions

View File

@@ -1,8 +1,35 @@
#include "test_tensor.h"
#include "main.h"
int main(void)
{
test_tensor_run_all();
tensor_test_run_all();
return 0;
}
void tensor_test_run_all(void)
{
int i;
void (*test_func[NUM_TEST_FUNC])(void) = {
&tensor_test_is_empty,
&tensor_test_is_equal,
&tensor_test_check_size,
&tensor_test_set_size,
&tensor_test_set,
&tensor_test_get,
&tensor_test_init_one,
&tensor_test_init_zero,
&tensor_test_init_rand,
&tensor_test_cpy,
&tensor_test_add_inplace,
&tensor_test_sub_inplace,
&tensor_test_add,
&tensor_test_sub,
};
printf("\n### Running tests... ###\n\n");
for(i = 0; i < NUM_TEST_FUNC; i++) {
test_func[i]();
}
printf("\n### %i functions tested. ###\n\n", NUM_TEST_FUNC);
}