summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-05-14 17:27:15 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-05-14 17:27:15 -0400
commit9fcb821db2f7c8e48372ee6e89fd48992d25a802 (patch)
treec13efdf7e41d56772e9f19b73ba704c33544c469 /test
parent13212dbdad82c4f614bb1e5f758e84370a085614 (diff)
tests: only define what's needed
Diffstat (limited to 'test')
-rw-r--r--test/pkarr.c2
-rw-r--r--test/pkarr.cpp3
-rw-r--r--test/pkbktarr.c3
-rw-r--r--test/pkbktarr.cpp3
-rw-r--r--test/pkev.c2
-rw-r--r--test/pkev.cpp5
-rw-r--r--test/pkmem-types.c2
-rw-r--r--test/pkmem.c5
-rw-r--r--test/pkmem.cpp5
-rw-r--r--test/pkstn.c2
-rw-r--r--test/pkstn.cpp2
-rw-r--r--test/pkstr.c2
-rw-r--r--test/pkstr.cpp2
-rw-r--r--test/pkuuid.c3
-rw-r--r--test/pkuuid.cpp3
15 files changed, 42 insertions, 2 deletions
diff --git a/test/pkarr.c b/test/pkarr.c
index c8878af..c6e09f1 100644
--- a/test/pkarr.c
+++ b/test/pkarr.c
@@ -2,6 +2,8 @@
// NOTE: only intended for performance testing
// TODO: move flag to compiler and run tests more than once for full coverage
#define PK_ARR_MOVE_IN_PLACE
+#define PK_IMPL_MEM
+#define PK_IMPL_ARR
#include "../pkarr.h"
diff --git a/test/pkarr.cpp b/test/pkarr.cpp
index 9e8acf7..77cf9f4 100644
--- a/test/pkarr.cpp
+++ b/test/pkarr.cpp
@@ -1,4 +1,7 @@
+#define PK_IMPL_MEM
+#define PK_IMPL_ARR
+
#include <cstring>
#include <utility>
diff --git a/test/pkbktarr.c b/test/pkbktarr.c
index 8bcb3e3..529c51b 100644
--- a/test/pkbktarr.c
+++ b/test/pkbktarr.c
@@ -1,4 +1,7 @@
+#include "../pkmem.h"
+#define PK_IMPL_MEM
+#define PK_IMPL_BKTARR
#include "../pkbktarr.h"
#include <setjmp.h>
diff --git a/test/pkbktarr.cpp b/test/pkbktarr.cpp
index e7fb5ee..8d691eb 100644
--- a/test/pkbktarr.cpp
+++ b/test/pkbktarr.cpp
@@ -1,4 +1,7 @@
+#include "../pkmem.h"
+#define PK_IMPL_MEM
+#define PK_IMPL_BKTARR
#include "../pkbktarr.h"
void test_spinup(struct pk_membucket **bkt_buckets, struct pk_membucket **bkt_data)
diff --git a/test/pkev.c b/test/pkev.c
index f28739b..e38ae9d 100644
--- a/test/pkev.c
+++ b/test/pkev.c
@@ -1,4 +1,6 @@
+#define PK_IMPL_EV
+
#include "../pkev.h"
#include "../pkmacros.h"
diff --git a/test/pkev.cpp b/test/pkev.cpp
index ed62803..30ccbb0 100644
--- a/test/pkev.cpp
+++ b/test/pkev.cpp
@@ -1,10 +1,13 @@
-#include "../pkev.h"
+#define PK_IMPL_EV
#include "../pkmacros.h"
+#include "../pkev.h"
+
#include <csetjmp>
#include <future>
+#include <stdatomic.h>
static bool expected_exit = false;
static bool caught = false;
diff --git a/test/pkmem-types.c b/test/pkmem-types.c
index a6f0174..8ed282d 100644
--- a/test/pkmem-types.c
+++ b/test/pkmem-types.c
@@ -1,4 +1,6 @@
+#define PK_IMPL_MEM_TYPES
+
#include "../pkmem-types.h"
#include "../pkmacros.h"
diff --git a/test/pkmem.c b/test/pkmem.c
index 024561d..78ea796 100644
--- a/test/pkmem.c
+++ b/test/pkmem.c
@@ -1,6 +1,11 @@
+#define PK_IMPL_MEM
+
#include "../pkmem.h"
+#include <stdio.h>
+#include <string.h>
+
struct mem_test {
struct pk_membucket *bkt1;
struct pk_membucket *bkt2;
diff --git a/test/pkmem.cpp b/test/pkmem.cpp
index ffc24b3..1a6dd8f 100644
--- a/test/pkmem.cpp
+++ b/test/pkmem.cpp
@@ -1,7 +1,10 @@
-#include <new>
+#define PK_IMPL_MEM
+
#include "../pkmem.h"
+#include <new>
+
class FreeTest {
public:
pk_membucket *bkt;
diff --git a/test/pkstn.c b/test/pkstn.c
index 032d7e2..92d982f 100644
--- a/test/pkstn.c
+++ b/test/pkstn.c
@@ -1,4 +1,6 @@
+#define PK_IMPL_STN
+
#include "../pkstn.h"
#include <stdio.h>
diff --git a/test/pkstn.cpp b/test/pkstn.cpp
index b6c9329..d29f216 100644
--- a/test/pkstn.cpp
+++ b/test/pkstn.cpp
@@ -1,4 +1,6 @@
+#define PK_IMPL_STN
+
#include "../pkstn.h"
#include <cstring>
diff --git a/test/pkstr.c b/test/pkstr.c
index 7b91fe7..f477e6a 100644
--- a/test/pkstr.c
+++ b/test/pkstr.c
@@ -1,4 +1,6 @@
+#define PK_IMPL_STR
+
#include "../pkstr.h"
#include "../pkmacros.h"
diff --git a/test/pkstr.cpp b/test/pkstr.cpp
index 58b60cd..c7b55bc 100644
--- a/test/pkstr.cpp
+++ b/test/pkstr.cpp
@@ -1,4 +1,6 @@
+#define PK_IMPL_STR
+
#include "../pkstr.h"
#include "../pkmacros.h"
diff --git a/test/pkuuid.c b/test/pkuuid.c
index 3ea66b0..8b489aa 100644
--- a/test/pkuuid.c
+++ b/test/pkuuid.c
@@ -1,6 +1,9 @@
// #define PK_UUID_CLOCK CLOCK_REALTIME_ALARM
+#define PK_IMPL_STN
+#define PK_IMPL_UUID
+
#include "../pkmacros.h"
#include "../pkuuid.h"
diff --git a/test/pkuuid.cpp b/test/pkuuid.cpp
index 5755c54..b5f54e8 100644
--- a/test/pkuuid.cpp
+++ b/test/pkuuid.cpp
@@ -1,6 +1,9 @@
// #define PK_UUID_CLOCK CLOCK_REALTIME_ALARM
+#define PK_IMPL_STN
+#define PK_IMPL_UUID
+
#include "../pkmacros.h"
#include "../pkuuid.h"