From 442a49ad5a48d417345959b903ae6a6d32d55759 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Fri, 15 Apr 2022 15:51:30 -0500 Subject: Great C programming fun Excellent fundamentals and displine training, many tools and techniques exercises: gdb, emacs, valgrind, git --- 33_counts/counts_test.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 33_counts/counts_test.c (limited to '33_counts/counts_test.c') diff --git a/33_counts/counts_test.c b/33_counts/counts_test.c new file mode 100644 index 0000000..905d918 --- /dev/null +++ b/33_counts/counts_test.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "counts.h" + +#define NUM_TESTS 12 +int main(void) { + char * testData[NUM_TESTS] = {"apple", "banana", NULL,"apple", + "frog","sword","bear",NULL, + "frog","apple", "zebra", "knight"}; + counts_t * testCounts= createCounts(); + for(int i =0; i < NUM_TESTS; i++) { + addCount(testCounts,testData[i]); + } + printCounts(testCounts, stdout); + freeCounts(testCounts); + return EXIT_SUCCESS; +} -- cgit v1.2.3