]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-magic: make unittests less specific
authorVictor Julien <victor@inliniac.net>
Wed, 25 Feb 2015 06:37:54 +0000 (07:37 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Mar 2015 16:25:09 +0000 (17:25 +0100)
So they pass on CentOS 5.11 as well.

src/util-magic.c

index 8b077d31c075c918c92884914cc66249f8feaa97..fa05c6d90eb64e2b5ff19f44a0950637263477e7 100644 (file)
@@ -398,8 +398,8 @@ int MagicDetectTest04(void)
     }
 
     result = (char *)magic_buffer(magic_ctx, (void *)buffer, buffer_len);
-    if (result == NULL || strcmp(result, "OpenOffice.org 1.x Database file") != 0) {
-        printf("result %p:%s, not \"OpenOffice.org 1.x Database file\": ", result,result?result:"(null)");
+    if (result == NULL || strncmp(result, "OpenOffice.org 1.x", 18) != 0) {
+        printf("result %p:%s, not \"OpenOffice.org 1.x\": ", result,result?result:"(null)");
         goto end;
     }
 
@@ -566,8 +566,8 @@ int MagicDetectTest08(void)
     }
 
     result = MagicGlobalLookup(buffer, buffer_len);
-    if (result == NULL || strcmp(result, "OpenOffice.org 1.x Database file") != 0) {
-        printf("result %p:%s, not \"OpenOffice.org 1.x Database file\": ", result,result?result:"(null)");
+    if (result == NULL || strncmp(result, "OpenOffice.org 1.x", 18) != 0) {
+        printf("result %p:%s, not \"OpenOffice.org 1.x\": ", result,result?result:"(null)");
         goto end;
     }