aboutsummaryrefslogtreecommitdiff
path: root/khm
diff options
context:
space:
mode:
Diffstat (limited to 'khm')
-rw-r--r--khm/Makefile8
-rw-r--r--khm/test_khm.c9
2 files changed, 15 insertions, 2 deletions
diff --git a/khm/Makefile b/khm/Makefile
new file mode 100644
index 0000000..74ffd5f
--- /dev/null
+++ b/khm/Makefile
@@ -0,0 +1,8 @@
+obj-m += test.o
+test-objs := khm.o test_khm.o
+
+all:
+ make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+
+clean:
+ make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
diff --git a/khm/test_khm.c b/khm/test_khm.c
index 5b822b5..d8b0180 100644
--- a/khm/test_khm.c
+++ b/khm/test_khm.c
@@ -1,6 +1,6 @@
#include <linux/module.h>
#include <linux/init.h>
-#include "khashmap.h"
+#include "khm.h"
#define Z_ASD 1
#define Z_QWE 2
@@ -14,6 +14,11 @@ static int __init test_init(void)
hm = khm_create();
+ if ((values = (char*)khm_get(hm, Z_BLR)))
+ printk(KERN_ALERT "ERROR: Z_BLR exists: %s\n", values);
+ else
+ printk(KERN_ALERT "Z_BLR does not exist (good)\n");
+
if (khm_insert(hm, Z_ASD, "ASDF"))
goto insert_err;
if (khm_insert(hm, Z_QWE, "QWERTY"))
@@ -46,7 +51,7 @@ static int __init test_init(void)
return 0;
insert_err:
- printk(KERN_ALERT "Error inserting!\n");
+ printk(KERN_ALERT "Error inserting (good)\n");
return 0;
}