about summary refs log tree commit diff
path: root/test/test-compcov.c
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2020-05-22 14:27:53 +0100
committerRobert Scott <code@humanleg.org.uk>2020-05-25 23:38:45 +0100
commit7e4c5b36365e0448a7afaaee72e65792a90ab64e (patch)
tree5926cdbd74f433e4c5fe8a5858cd48c2dc7f5620 /test/test-compcov.c
parent1e597a64dcb4eba23785f6c2c094c3d868982cc4 (diff)
downloadafl++-7e4c5b36365e0448a7afaaee72e65792a90ab64e.tar.gz
tests: add test of compiled compcov binary's functionality
Diffstat (limited to 'test/test-compcov.c')
-rw-r--r--test/test-compcov.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/test-compcov.c b/test/test-compcov.c
index a2202a22..4959c39c 100644
--- a/test/test-compcov.c
+++ b/test/test-compcov.c
@@ -20,9 +20,19 @@ int main(int argc, char **argv) {
   }
 
   if (strcmp(input, "LIBTOKENCAP") == 0)
-    printf("your string was libtokencap\n");
+    printf("your string was LIBTOKENCAP\n");
   else if (strcmp(input, "BUGMENOT") == 0)
-    printf("your string was bugmenot\n");
+    printf("your string was BUGMENOT\n");
+  else if (strncmp(input, "BANANA", 3) == 0)
+    printf("your string started with BAN\n");
+  else if (strcmp(input, "APRI\0COT") == 0)
+    printf("your string was APRI\n");
+  else if (strcasecmp(input, "Kiwi") == 0)
+    printf("your string was Kiwi\n");
+  else if (strncasecmp(input, "avocado", 9) == 0)
+    printf("your string was avocado\n");
+  else if (strncasecmp(input, "Grapes", argc > 2 ? atoi(argv[2]) : 3) == 0)
+    printf("your string was a prefix of Grapes\n");
   else if (strcmp(input, "BUFFEROVERFLOW") == 0) {
 
     buf = (char *)malloc(16);