summaryrefslogtreecommitdiffhomepage
path: root/misc/tests
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-02 22:00:08 +0100
committerTyge Løvset <[email protected]>2023-02-02 22:00:08 +0100
commit9bc4e3b53839d73af7e7d11043fb9e1b064836e3 (patch)
tree98f111d1817b14c812033cd1103395ee295ea2e4 /misc/tests
parent473a13c1c15b8c1e1edc79cff074c0dcf490fc1b (diff)
downloadSTC-modified-9bc4e3b53839d73af7e7d11043fb9e1b064836e3.tar.gz
STC-modified-9bc4e3b53839d73af7e7d11043fb9e1b064836e3.zip
Removed old archived csmap.h and cstr.h. Renamed ctest fixture fix to _self.
Diffstat (limited to 'misc/tests')
-rw-r--r--misc/tests/cspan_test.c22
-rw-r--r--misc/tests/ctest.h24
2 files changed, 23 insertions, 23 deletions
diff --git a/misc/tests/cspan_test.c b/misc/tests/cspan_test.c
index 3f03ef0f..26a662e6 100644
--- a/misc/tests/cspan_test.c
+++ b/misc/tests/cspan_test.c
@@ -86,21 +86,21 @@ CTEST_FIXTURE(cspan_cube) {
CTEST_SETUP(cspan_cube) {
enum {TSIZE=4, CUBE=64, N=CUBE*CUBE*CUBE};
- fix->stack = cstack_int_init();
- fix->tiles = Tiles_init();
+ _self->stack = cstack_int_init();
+ _self->tiles = Tiles_init();
- cstack_int_reserve(&fix->stack, N);
+ cstack_int_reserve(&_self->stack, N);
c_FORRANGE (i, N)
- cstack_int_push(&fix->stack, i+1);
+ cstack_int_push(&_self->stack, i+1);
- intspan3 ms3 = cspan_md(fix->stack.data, CUBE, CUBE, CUBE);
+ intspan3 ms3 = cspan_md(_self->stack.data, CUBE, CUBE, CUBE);
c_FORRANGE (i, 0, ms3.dim[0], TSIZE) {
c_FORRANGE (j, 0, ms3.dim[1], TSIZE) {
c_FORRANGE (k, 0, ms3.dim[2], TSIZE) {
intspan3 tile = ms3;
cspan_slice(&tile, {i, i + TSIZE}, {j, j + TSIZE}, {k, k + TSIZE});
- Tiles_push(&fix->tiles, tile);
+ Tiles_push(&_self->tiles, tile);
}
}
}
@@ -108,18 +108,18 @@ CTEST_SETUP(cspan_cube) {
// Optional teardown function for suite, called after every test in suite
CTEST_TEARDOWN(cspan_cube) {
- cstack_int_drop(&fix->stack);
- Tiles_drop(&fix->tiles);
+ cstack_int_drop(&_self->stack);
+ Tiles_drop(&_self->tiles);
}
CTEST_F(cspan_cube, slice3) {
- intptr_t n = cstack_int_size(&fix->stack);
- //printf("\ntiles: %zi, cells: %zi\n", Tiles_size(&fix->tiles), n);
+ intptr_t n = cstack_int_size(&_self->stack);
+ //printf("\ntiles: %zi, cells: %zi\n", Tiles_size(&_self->tiles), n);
int64_t sum = 0;
// iterate each 3d tile in sequence
- c_FOREACH (i, Tiles, fix->tiles)
+ c_FOREACH (i, Tiles, _self->tiles)
c_FOREACH (t, intspan3, *i.ref)
sum += *t.ref;
diff --git a/misc/tests/ctest.h b/misc/tests/ctest.h
index 6cfb507a..4d42216c 100644
--- a/misc/tests/ctest.h
+++ b/misc/tests/ctest.h
@@ -113,14 +113,14 @@ struct ctest {
#ifdef __cplusplus
#define CTEST_SETUP(sname) \
- template <> void CTEST_IMPL_SETUP_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix)
+ template <> void CTEST_IMPL_SETUP_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self)
#define CTEST_TEARDOWN(sname) \
- template <> void CTEST_IMPL_TEARDOWN_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix)
+ template <> void CTEST_IMPL_TEARDOWN_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self)
#define CTEST_FIXTURE(sname) \
- template <typename T> void CTEST_IMPL_SETUP_FNAME(sname)(T* fix) { } \
- template <typename T> void CTEST_IMPL_TEARDOWN_FNAME(sname)(T* fix) { } \
+ template <typename T> void CTEST_IMPL_SETUP_FNAME(sname)(T* _self) { } \
+ template <typename T> void CTEST_IMPL_TEARDOWN_FNAME(sname)(T* _self) { } \
struct CTEST_IMPL_DATA_SNAME(sname)
#define CTEST_IMPL_CTEST(sname, tname, tskip) \
@@ -130,23 +130,23 @@ struct ctest {
#define CTEST_IMPL_CTEST_F(sname, tname, tskip) \
static struct CTEST_IMPL_DATA_SNAME(sname) CTEST_IMPL_DATA_TNAME(sname, tname); \
- static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix); \
+ static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self); \
static void (*CTEST_IMPL_SETUP_TPNAME(sname, tname))(struct CTEST_IMPL_DATA_SNAME(sname)*) = &CTEST_IMPL_SETUP_FNAME(sname)<struct CTEST_IMPL_DATA_SNAME(sname)>; \
static void (*CTEST_IMPL_TEARDOWN_TPNAME(sname, tname))(struct CTEST_IMPL_DATA_SNAME(sname)*) = &CTEST_IMPL_TEARDOWN_FNAME(sname)<struct CTEST_IMPL_DATA_SNAME(sname)>; \
CTEST_IMPL_STRUCT(sname, tname, tskip, &CTEST_IMPL_DATA_TNAME(sname, tname), &CTEST_IMPL_SETUP_TPNAME(sname, tname), &CTEST_IMPL_TEARDOWN_TPNAME(sname, tname)); \
- static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix)
+ static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self)
#else
#define CTEST_SETUP(sname) \
- static void CTEST_IMPL_SETUP_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix); \
+ static void CTEST_IMPL_SETUP_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self); \
static void (*CTEST_IMPL_SETUP_FPNAME(sname))(struct CTEST_IMPL_DATA_SNAME(sname)*) = &CTEST_IMPL_SETUP_FNAME(sname); \
- static void CTEST_IMPL_SETUP_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix)
+ static void CTEST_IMPL_SETUP_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self)
#define CTEST_TEARDOWN(sname) \
- static void CTEST_IMPL_TEARDOWN_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix); \
+ static void CTEST_IMPL_TEARDOWN_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self); \
static void (*CTEST_IMPL_TEARDOWN_FPNAME(sname))(struct CTEST_IMPL_DATA_SNAME(sname)*) = &CTEST_IMPL_TEARDOWN_FNAME(sname); \
- static void CTEST_IMPL_TEARDOWN_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix)
+ static void CTEST_IMPL_TEARDOWN_FNAME(sname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self)
#define CTEST_FIXTURE(sname) \
struct CTEST_IMPL_DATA_SNAME(sname); \
@@ -161,9 +161,9 @@ struct ctest {
#define CTEST_IMPL_CTEST_F(sname, tname, tskip) \
static struct CTEST_IMPL_DATA_SNAME(sname) CTEST_IMPL_DATA_TNAME(sname, tname); \
- static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix); \
+ static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self); \
CTEST_IMPL_STRUCT(sname, tname, tskip, &CTEST_IMPL_DATA_TNAME(sname, tname), &CTEST_IMPL_SETUP_FPNAME(sname), &CTEST_IMPL_TEARDOWN_FPNAME(sname)); \
- static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* fix)
+ static void CTEST_IMPL_FNAME(sname, tname)(struct CTEST_IMPL_DATA_SNAME(sname)* _self)
#endif