From ee6e2d945ed6ce17fff892f799beb2d57935c748 Mon Sep 17 00:00:00 2001 From: wes Date: Wed, 5 Jul 2017 21:01:41 -0400 Subject: [PATCH] test cases, remove useless headers --- bfilter.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bfilter.c b/bfilter.c index 219d15d..03da912 100644 --- a/bfilter.c +++ b/bfilter.c @@ -1,13 +1,7 @@ -#include #include #include #include -#include -#include -#include #include - -#include "error.h" #include "bfilter.h" int @@ -177,14 +171,32 @@ bfilter_get(bit_array_t *filter, int main (void) { - bit_array_t *test = empty_bfilter(100); + bit_array_t *test = empty_bfilter(35); const char *test_string = "what tf is this I can't even, lololol"; const char *test_string2 = "tf is this I can't even, lololol"; + const char *test_string3 = "tf is blah blablablah can't even, lololol"; + const char *test_string4 = "tf 't even, lololol"; + const char *test_string5 = "tf aaasdasdsd't even, lololol"; + const char *test_string6 = "asdsdfsdfsdftf aaasdasdsd't even, lololol"; + const char *test_string7 = "weretrert ewerr eaaasdasdsd't even, lololol"; + const char *test_string8 = "weretrert ewerr asdfert34234234even, lololol"; + const char *test_string9 = "edsfefsdfwerr asdfert34234234even, lololol"; + const char *test_string10 = "edsfefsdfwerr sdfdgfgdfgdfg, lololol"; + + const char *test_string11 = "this isn't actually in the bloom filter"; bfilter_set(test, test_string); bfilter_set(test, test_string2); - - printf("%d\n", bfilter_get(test, test_string2)); + bfilter_set(test, test_string3); + bfilter_set(test, test_string4); + bfilter_set(test, test_string5); + bfilter_set(test, test_string6); + bfilter_set(test, test_string7); + bfilter_set(test, test_string8); + bfilter_set(test, test_string9); + bfilter_set(test, test_string10); + + printf("%d\n", bfilter_get(test, test_string11)); print_barray(test);