summaryrefslogtreecommitdiff
path: root/test/pkmem-types.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/pkmem-types.c')
-rw-r--r--test/pkmem-types.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/pkmem-types.c b/test/pkmem-types.c
new file mode 100644
index 0000000..2399308
--- /dev/null
+++ b/test/pkmem-types.c
@@ -0,0 +1,42 @@
+
+#include "../pkmem-types.h"
+#include "../pkmacros.h"
+
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ (void)argc;
+ (void)argv;
+ (void)stdout;
+
+ // pk_handle_validate
+ {
+ enum PK_HANDLE_VALIDATION res;
+ struct pk_handle h, bh;
+
+ bh.bucketIndex = 2;
+ bh.itemIndex = 2;
+
+ h.bucketIndex = 0;
+ h.itemIndex = 0;
+ res = pk_handle_validate(h, bh, 1024);
+ PK_LOGV_INF("pk_handle_validate 000: %i\n", res);
+
+ h.bucketIndex = 3;
+ h.itemIndex = 0;
+ res = pk_handle_validate(h, bh, 1024);
+ PK_LOGV_INF("pk_handle_validate 001: %i\n", res);
+
+ h.bucketIndex = 2;
+ h.itemIndex = 3;
+ res = pk_handle_validate(h, bh, 1024);
+ PK_LOGV_INF("pk_handle_validate 002: %i\n", res);
+
+ h = pk_handle_MAX;
+ res = pk_handle_validate(h, bh, 1024);
+ PK_LOGV_INF("pk_handle_validate 003: %i\n", res);
+ }
+
+ return 0;
+}