diff options
Diffstat (limited to 'khashmap/test_khashmap.c')
-rw-r--r-- | khashmap/test_khashmap.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/khashmap/test_khashmap.c b/khashmap/test_khashmap.c deleted file mode 100644 index 16a351f..0000000 --- a/khashmap/test_khashmap.c +++ /dev/null @@ -1,61 +0,0 @@ -#include <linux/module.h> -#include <linux/init.h> -#include "khashmap.h" - -#define Z_ASD 1 -#define Z_QWE 2 -#define Z_BLR 3 - -static struct khashmap *hm; - -static int __init test_init(void) -{ - char *values; - - hm = khm_create(); - - if (khm_insert(hm, Z_ASD, "ASDF")) - goto insert_err; - if (khm_insert(hm, Z_QWE, "QWERTY")) - goto insert_err; - if (khm_insert(hm, Z_BLR, "BLRBLRBLR")) - goto insert_err; - - khm_display(hm); - khm_delete(hm, Z_QWE); - khm_display(hm); - khm_set(hm, Z_ASD, "ASDF NEW!!"); - khm_display(hm); - - if ((values = (char*)khm_get(hm, Z_ASD))) - printk(KERN_ALERT "Z_ASD: %s\n", values); - else - printk(KERN_ALERT "Z_ASD does not exist\n"); - if ((values = (char*)khm_get(hm, Z_QWE))) - printk(KERN_ALERT "Z_QWE: %s\n", values); - else - printk(KERN_ALERT "Z_QWE does not exist\n"); - if ((values = (char*)khm_get(hm, Z_BLR))) - printk(KERN_ALERT "Z_BLR: %s\n", values); - else - printk(KERN_ALERT "Z_BLR does not exist\n"); - - if (khm_insert(hm, Z_ASD, "MALO!!")) - goto insert_err; - - return 0; - -insert_err: - printk(KERN_ALERT "Error inserting!\n"); - return 0; -} - -static void __exit test_exit(void) -{ - khm_destroy(hm); -} - -module_init(test_init); -module_exit(test_exit); - -MODULE_LICENSE("GPL"); |