diff options
uri_test.c: fixup
2 files changed, 16 insertions, 9 deletions
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | uri_test.c | 23 |
@@ -47,7 +47,7 @@ badwolf: $(OBJS) uri_test: uri.o uri_test.o $(CC) -std=c11 -o $@ uri.o uri_test.o $(LDFLAGS) $(LIBS) - ./$@ + $(DBG) ./$@ .PHONY: test test: $(EXE_test) @@ -18,17 +18,21 @@ badwolf_ensure_uri_scheme_test(void) const gchar *text; gboolean try_file; } cases[] = { - // clang formatting hack + // + {"http://uri.c", "http://uri.c", FALSE}, + {"http://uri.c", "http://uri.c", TRUE}, + {"file:///dev/null", "file:///dev/null", FALSE}, + {"file:///dev/null", "file:///dev/null", TRUE}, {fallback, NULL, FALSE}, {fallback, NULL, TRUE}, {fallback, "", FALSE}, {fallback, "", TRUE}, - {fallback, "/dev/null", FALSE}, - //{"file://dev/null", "/dev/null", TRUE}, - //{"http://example.org", "example.org", FALSE}, - //{"http://example.org", "example.org", TRUE}, - //{fallback, "http://", FALSE}, - //{fallback, "http://", TRUE} + {"http:///dev/null", "/dev/null", FALSE}, + {"file:///dev/null", "/dev/null", TRUE}, + {"http://example.org", "example.org", FALSE}, + {"http://example.org", "example.org", TRUE}, + {"http://", "http://", FALSE}, + {"http://", "http://", TRUE} // }; for(size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) @@ -39,7 +43,10 @@ badwolf_ensure_uri_scheme_test(void) const gchar *got = badwolf_ensure_uri_scheme(cases[i].text, cases[i].try_file); - if(got != cases[i].expect) g_error("expected: \"%s\", got: \"%s\"", cases[i].expect, got); + if(g_strcmp0(got, cases[i].expect) != 0) + { + g_error("expected: \"%s\", got: \"%s\"", cases[i].expect, got); + } } } |