Added more tests.
This commit is contained in:
28
tests/main.c
28
tests/main.c
@@ -3,13 +3,14 @@
|
||||
int main(void)
|
||||
{
|
||||
tensor_test_run_all();
|
||||
tensoriter_test_run_all();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tensor_test_run_all(void)
|
||||
{
|
||||
int i;
|
||||
void (*test_func[NUM_TEST_FUNC])(void) = {
|
||||
void (*test_func[NUM_TENSOR_TEST_FUNC])(void) = {
|
||||
&tensor_test_is_empty,
|
||||
&tensor_test_is_equal,
|
||||
&tensor_test_check_size,
|
||||
@@ -26,10 +27,29 @@ void tensor_test_run_all(void)
|
||||
&tensor_test_sub,
|
||||
};
|
||||
|
||||
printf("\n### Running tests... ###\n\n");
|
||||
for(i = 0; i < NUM_TEST_FUNC; i++) {
|
||||
printf("\n### Running tests for tensor.c ... ###\n\n");
|
||||
for(i = 0; i < NUM_TENSOR_TEST_FUNC; i++) {
|
||||
test_func[i]();
|
||||
}
|
||||
printf("\n### %i functions tested. ###\n\n", NUM_TEST_FUNC);
|
||||
printf("\n### %i functions tested. ###\n\n", NUM_TENSOR_TEST_FUNC);
|
||||
}
|
||||
|
||||
void tensoriter_test_run_all(void)
|
||||
{
|
||||
int i;
|
||||
void (*test_func[NUM_TENSORITER_TEST_FUNC])(void) = {
|
||||
&tensoriter_test_scalar_next,
|
||||
&tensoriter_test_scalar_get,
|
||||
&tensoriter_test_scalar_map,
|
||||
&tensoriter_test_scalar_map_add,
|
||||
&tensoriter_test_scalar_map_sub,
|
||||
&tensoriter_test_scalar_map_mul,
|
||||
&tensoriter_test_scalar_map_div,
|
||||
};
|
||||
|
||||
printf("\n### Running tests for tensoriter.c ... ###\n\n");
|
||||
for(i = 0; i < NUM_TENSORITER_TEST_FUNC; i++) {
|
||||
test_func[i]();
|
||||
}
|
||||
printf("\n### %i functions tested. ###\n\n", NUM_TENSORITER_TEST_FUNC);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user