diff options
author | Stef Walter <stefw@redhat.com> | 2013-04-03 10:50:59 +0200 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-04-03 12:45:43 +0200 |
commit | a63311a0f3f2669138d09ff8f618fd4d12fa0c3d (patch) | |
tree | d5a9b8cd32dda2e0e1eff1a8393b5dcb2174f86b /common/tests/test-compat.c | |
parent | c3f1b0a45eb1c28b6f025f8ae56c3b020801b6aa (diff) |
More compatible path munging and handling code
Centralize the path handling code, so we can remove unixy assumptions
and have a chance of running on Windows. The current goal is to run
all the tests on Windows.
Includes some code from LRN <lrn1986@gmail.com>
https://bugs.freedesktop.org/show_bug.cgi?id=63062
Diffstat (limited to 'common/tests/test-compat.c')
-rw-r--r-- | common/tests/test-compat.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/common/tests/test-compat.c b/common/tests/test-compat.c index a94aaeb..066e723 100644 --- a/common/tests/test-compat.c +++ b/common/tests/test-compat.c @@ -42,37 +42,6 @@ #include "compat.h" static void -test_basename (CuTest *tc) -{ - struct { - const char *in; - const char *out; - } fixtures[] = { - { "/this/is/a/path", "path" }, - { "/this/is/a/folder/", "folder" }, - { "folder/", "folder" }, - { "/", "" }, - { "this", "this" }, -#ifdef OS_WIN32 - { "\\this\\is\\a\\path", "path" }, - { "\\this\\is\\a\\folder\\", "folder" }, - { "folder\\", "folder" }, - { "\\", "" }, -#endif - { NULL }, - }; - - char *out; - int i; - - for (i = 0; fixtures[i].in != NULL; i++) { - out = p11_basename (fixtures[i].in); - CuAssertStrEquals (tc, fixtures[i].out, out); - free (out); - } -} - -static void test_strndup (CuTest *tc) { char unterminated[] = { 't', 'e', 's', 't', 'e', 'r', 'o', 'n', 'i', 'o' }; @@ -94,7 +63,6 @@ main (void) CuSuite* suite = CuSuiteNew (); int ret; - SUITE_ADD_TEST (suite, test_basename); SUITE_ADD_TEST (suite, test_strndup); CuSuiteRun (suite); |