summaryrefslogtreecommitdiff
path: root/tests/pke-test-types.h
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-03-11 20:39:41 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-03-12 12:30:58 -0400
commit68ef51ed3247dc4e7bd5970b9279a7d6a938ca52 (patch)
tree169f75207bca7650a390ed812476ff3037978dae /tests/pke-test-types.h
parenteae4525970d5a689f09d82e1f73218cb16168b9b (diff)
pke: pke test scaffolding
Diffstat (limited to 'tests/pke-test-types.h')
-rw-r--r--tests/pke-test-types.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/pke-test-types.h b/tests/pke-test-types.h
new file mode 100644
index 0000000..5278eae
--- /dev/null
+++ b/tests/pke-test-types.h
@@ -0,0 +1,30 @@
+#ifndef PKE_PKE_TEST_TYPES_H
+#define PKE_PKE_TEST_TYPES_H
+
+#include <setjmp.h>
+#include <stdint.h>
+
+struct pke_test_long_jump {
+ uint8_t expected_exit;
+ uint8_t caught;
+ jmp_buf jump_env;
+};
+extern struct pke_test_long_jump lj;
+
+typedef int (pke_test_func)();
+struct pke_test_group;
+typedef struct pke_test_group *(pke_test_get_group)();
+
+struct pke_test {
+ const char *title;
+ pke_test_func *func;
+ int expected_result;
+};
+
+struct pke_test_group {
+ const char *title;
+ struct pke_test *tests;
+ uint32_t n_tests;
+};
+
+#endif /* PKE_PKE_TEST_TYPES_H */