X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=917fea944b8d0c770c6539e5c8b9ddcb578a1431;hb=9a8889e4d0c532b9f77af3a9cc7aae06adebfb83;hp=3a25c5707ec9eb10c4b5797130440d694a69545b;hpb=9353c6253d5fac1648b13ad9958468a2d9f6ad6f;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 3a25c57..917fea9 100644 --- a/src/generator.ml +++ b/src/generator.ml @@ -5878,9 +5878,9 @@ static int %s_skip (void) if (str) return strstr (str, \"%s\") == NULL; str = getenv (\"SKIP_%s\"); - if (str && strcmp (str, \"1\") == 0) return 1; + if (str && STREQ (str, \"1\")) return 1; str = getenv (\"SKIP_TEST_%s\"); - if (str && strcmp (str, \"1\") == 0) return 1; + if (str && STREQ (str, \"1\")) return 1; return 0; } @@ -6146,7 +6146,7 @@ and generate_one_test_body name i test_name init test = pr " fprintf (stderr, \"%s: returned size of buffer wrong, expected %d but got %%zu\\n\", size);\n" test_name len; pr " return -1;\n"; pr " }\n"; - pr " if (strncmp (r, expected, size) != 0) {\n"; + pr " if (STRNEQLEN (r, expected, size)) {\n"; pr " fprintf (stderr, \"%s: expected \\\"%%s\\\" but got \\\"%%s\\\"\\n\", expected, r);\n" test_name; pr " return -1;\n"; pr " }\n" @@ -9570,7 +9570,7 @@ print_strings (char *const *argv) pr " sscanf (val, \"%%\" SCNi64, &r);\n"; pr " return r;\n" | RBool _ -> - pr " return strcmp (val, \"true\") == 0;\n" + pr " return STREQ (val, \"true\");\n" | RConstString _ | RConstOptString _ -> (* Can't return the input string here. Return a static