Summary Files Commits Branches @commit @diff @stats
path: root / uri_test.c
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 /uri_test.c
goodwolf-9579ef40ff0c16b905a444903688f2f343ff91a6.tar
goodwolf-9579ef40ff0c16b905a444903688f2f343ff91a6.tar.gz
goodwolf-9579ef40ff0c16b905a444903688f2f343ff91a6.zip
Parentffd482d156a0acf02656277d86e10d29d3539363 (diff)
uri_test.c: fixup
1 files changed, 15 insertions, 8 deletions
-rw-r--r--uri_test.c23
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);
+ }
}
}