X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftest%2Furl.c;h=f4b665138dbe28fb674aeeecd58ce5dc6b837a26;hb=71decd73e3f84749d914cf5a48a55b80046ca052;hp=64060b5c2eb6b80fe2e4958f9806588918fb39c7;hpb=f7aa8a5308253dc1a29d59ff1069d929eb18cb1a;p=vlc diff --git a/src/test/url.c b/src/test/url.c index 64060b5c2e..f4b665138d 100644 --- a/src/test/url.c +++ b/src/test/url.c @@ -37,12 +37,19 @@ static void test (conv_t f, const char *in, const char *out) { char *res; - printf ("\"%s\" -> \"%s\" ?\n", in, out); + if (out != NULL) + printf ("\"%s\" -> \"%s\" ?\n", in, out); + else + printf ("\"%s\" -> NULL ?\n", in); res = f (in); if (res == NULL) - exit (1); - - if (strcmp (res, out)) + { + if (out == NULL) + return; /* good: NULL -> NULL */ + puts (" ERROR: got NULL"); + exit (2); + } + if (out == NULL || strcmp (res, out)) { printf (" ERROR: got \"%s\"\n", res); exit (2);