summaryrefslogtreecommitdiff
path: root/test/pkmem-types.c
blob: 8ed282da679a4b46b3a00cc9735ffff6aac94840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

#define PK_IMPL_MEM_TYPES

#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;
}