X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-dirname.c;h=a017bce9d528acce7bb97238562c7608b95bed4a;hb=790fade563cb6461d9f2b78775e8bd53e66a2566;hp=bda1ee874a1ebc73b06d11737277426c5056f1c4;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/tests/test-dirname.c b/tests/test-dirname.c index bda1ee874..a017bce9d 100644 --- a/tests/test-dirname.c +++ b/tests/test-dirname.c @@ -1,5 +1,5 @@ /* Test the gnulib dirname module. - Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ static struct test tests[] = { {"", ".", "", "", "", false, false}, {".", ".", ".", ".", ".", false, false}, {"..", ".", "..", "..", "..", false, false}, -#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR +#if ISSLASH ('\\') {"a\\", ".", "a\\", "a\\", "a", true, false}, {"a\\b", "a", "b", "b", "a\\b", false, false}, {"\\", "\\", "", "\\", "\\", false, true}, @@ -75,7 +75,7 @@ static struct test tests[] = { {"//\\", "/", "\\", "\\", "//\\", false, true}, # endif #endif -#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX +#if ISSLASH ('\\') # if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE {"c:", "c:", "", "c:", "c:", false, false}, {"c:/", "c:/", "", "c:/", "c:/", false, true}, @@ -105,7 +105,7 @@ static struct test tests[] = { {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false}, {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false}, # endif -#else /* ! FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX */ +#else /* ! ISSLASH ('\\') */ {"c:", ".", "c:", "c:", "c:", false, false}, {"c:/", ".", "c:/", "c:/", "c:", true, false}, {"c://", ".", "c://", "c:/", "c:", true, false}, @@ -149,14 +149,15 @@ main (void) || (dirlen + 1 == strlen (dir) && dir[dirlen] == '.')))) { ok = false; - printf ("dir_name `%s': got `%s' len %d, expected `%s' len %ld\n", + printf ("dir_name '%s': got '%s' len %d," + " expected '%s' len %ld\n", t->name, dir, dirlen, t->dir, (unsigned long) strlen (t->dir)); } if (strcmp (last, t->last)) { ok = false; - printf ("last_component `%s': got `%s', expected `%s'\n", + printf ("last_component '%s': got '%s', expected '%s'\n", t->name, last, t->last); } if (! (strcmp (base, t->base) == 0 @@ -165,21 +166,22 @@ main (void) && ISSLASH (base[baselen]))))) { ok = false; - printf ("base_name `%s': got `%s' len %d, expected `%s' len %ld\n", + printf ("base_name '%s': got '%s' len %d," + " expected '%s' len %ld\n", t->name, base, baselen, t->base, (unsigned long) strlen (t->base)); } if (strcmp (stripped, t->stripped) || modified != t->modified) { ok = false; - printf ("strip_trailing_slashes `%s': got %s %s, expected %s %s\n", + printf ("strip_trailing_slashes '%s': got %s %s, expected %s %s\n", t->name, stripped, modified ? "changed" : "unchanged", t->stripped, t->modified ? "changed" : "unchanged"); } if (t->absolute != absolute) { ok = false; - printf ("`%s': got %s, expected %s\n", t->name, + printf ("'%s': got %s, expected %s\n", t->name, absolute ? "absolute" : "relative", t->absolute ? "absolute" : "relative"); }