aboutsummaryrefslogtreecommitdiff
path: root/tests/coord_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/coord_tests.c')
-rw-r--r--tests/coord_tests.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/tests/coord_tests.c b/tests/coord_tests.c
deleted file mode 100644
index 8d6b6d3..0000000
--- a/tests/coord_tests.c
+++ /dev/null
@@ -1,50 +0,0 @@
1#include "coord_tests.h"
2
3bool testmethod_indexes_consistent(void *);
4
5Test test_indexes_consistent = {
6 .name = "Consitency of index and anti-index",
7 .t = testmethod_indexes_consistent,
8 .cases = (void **)all_coordinates,
9};
10Test *coord_pre_init[] = {
11 &test_indexes_consistent,
12 NULL
13};
14TestSuite coord_pre_init_suite = {
15 .setup = NULL,
16 .tests = coord_pre_init,
17 .teardown = NULL,
18};
19
20TestSuite *coord_suites[] = {
21 &coord_pre_init_suite,
22 NULL
23};
24
25bool
26testmethod_indexes_consistent(void *a)
27{
28 uint64_t ui, uj;
29 Cube c;
30 Coordinate *coord;
31
32 coord = (Coordinate *)a;
33
34 if (coord->type != COMP_COORD)
35 return true; /* Not applicable */
36
37 gen_coord(coord);
38 for (ui = 0; ui < coord->max; ui++) {
39 indexers_makecube(coord->i, ui, &c);
40 uj = indexers_getind(coord->i, &c);
41 if (ui != uj) {
42 fprintf(stderr, "Error with coordinate %s: "
43 "%" PRIu64 " != %" PRIu64 "\n",
44 coord->name, uj, ui);
45 return false;
46 }
47 }
48
49 return true;
50}

Generated with cgit - Back to sebastiano.tronto.net