Typo.
[apps/pfixtools.git] / postlicyd / tst-filters.c
index 7bcaa41..9b83fad 100644 (file)
@@ -62,6 +62,8 @@ static char *read_query(const char *basepath, const char *filename,
         if (end != NULL) {
             *end = buff + (map.end - map.map);
             **end = '\0';
+        } else {
+            buff[map.end - map.map] = '\0';
         }
         file_map_close(&map);
     }
@@ -175,6 +177,8 @@ static bool run_greylisttest(const config_t *config, const char *basepath)
     TEST("auto_whitelisted", filter_test(greylist1, &q1, HTK_WHITELIST));
     TEST("other_auto_whitelisted", filter_test(greylist1, &q2, HTK_WHITELIST));
     TEST("greylisted", filter_test(greylist1, &q3, HTK_GREYLIST));
+    sleep(10);
+    TEST("cleanup", filter_test(greylist1, &q1, HTK_GREYLIST));
 
     return ok;
 }
@@ -198,8 +202,8 @@ int main(int argc, char *argv[])
 #define RM(File)                                                               \
       snprintf(path, FILENAME_MAX, "%s/%s", basepath, File);                   \
       unlink(path);
-      RM("test1_greylist.db");
-      RM("test1_whitelist.db");
+//      RM("test1_greylist.db");
+//      RM("test1_whitelist.db");
       RM("test2_greylist.db");
       RM("test2_whitelist.db");
 #undef RM