diff options
author | Haidong Ji | 2022-04-15 15:51:30 -0500 |
---|---|---|
committer | Haidong Ji | 2022-04-15 15:51:30 -0500 |
commit | 442a49ad5a48d417345959b903ae6a6d32d55759 (patch) | |
tree | c7127bb497e5e439018b1915e0136eec2c9cb124 /32_kvs/kv_test.c |
Excellent fundamentals and displine training, many tools and techniques
exercises: gdb, emacs, valgrind, git
Diffstat (limited to '32_kvs/kv_test.c')
-rw-r--r-- | 32_kvs/kv_test.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/32_kvs/kv_test.c b/32_kvs/kv_test.c new file mode 100644 index 0000000..5532512 --- /dev/null +++ b/32_kvs/kv_test.c @@ -0,0 +1,17 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "kv.h" + +#define NUM_LOOKUPS 5 +int main(void) { + kvarray_t * array = readKVs("test.txt"); + printf("Printing all keys\n\n"); + printKVs(array); + char *tests[NUM_LOOKUPS] = {"banana", "grapes", "cantaloupe", "lettuce", "orange"}; + for (int i = 0; i < NUM_LOOKUPS; i++) { + printf("lookupValue('%s')=%s\n", tests[i], lookupValue(array,tests[i])); + } + freeKVs(array); + return EXIT_SUCCESS; +} |