Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit9579ef40ff0c16b905a444903688f2f343ff91a6 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-12-16 03:24:30 +0100
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-12-16 03:24:30 +0100
Files20545d91b3dc12dedcc409bb983ca436c8b17f99
goodwolf-9579ef40ff0c16b905a444903688f2f343ff91a6.tar
goodwolf-9579ef40ff0c16b905a444903688f2f343ff91a6.tar.gz
goodwolf-9579ef40ff0c16b905a444903688f2f343ff91a6.zip
Parentffd482d156a0acf02656277d86e10d29d3539363 (diff)
uri_test.c: fixup
2 files changed, 16 insertions, 9 deletions
-rw-r--r--Makefile2
-rw-r--r--uri_test.c23
diff --git a/Makefile b/Makefile
index c065d79..2612ad5 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/uri_test.c b/uri_test.c
index c5ebe7e..13fa3eb 100644
--- a/uri_test.c
+++ b/uri_test.c
@@ -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);
+ }
}
}