From a63311a0f3f2669138d09ff8f618fd4d12fa0c3d Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 3 Apr 2013 10:50:59 +0200 Subject: 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 https://bugs.freedesktop.org/show_bug.cgi?id=63062 --- common/tests/test-compat.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'common/tests/test-compat.c') 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); -- cgit v1.1