]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'public/bug5089'
authorNick Mathewson <nickm@torproject.org>
Thu, 31 May 2012 20:21:54 +0000 (16:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 31 May 2012 20:21:54 +0000 (16:21 -0400)
Conflicts:
src/test/test_util.c

Merge the unit tests; I added some when I did this branch against
0.2.2, and then the test format changed and master added more tests.

1  2 
src/common/compat.c
src/test/test_util.c

index 59c7ca4c5a89be3adbe91332fa829e5143596200,ffd972482457fc45cc031945ab59048b3d8eb0f7..093106120def0863278ed7a5bb06277e4cfb17d9
@@@ -1678,9 -1507,9 +1682,9 @@@ get_parent_directory(char *fname
     */
    cp = fname + strlen(fname);
    at_end = 1;
-   while (--cp > fname) {
+   while (--cp >= fname) {
      int is_sep = (*cp == '/'
 -#ifdef MS_WINDOWS
 +#ifdef _WIN32
                    || *cp == '\\'
  #endif
                    );
index 99c55445085173e668650bdec10cdcedb69f9ad0,a393079e14dc49c98ae05d1c3462ca76aa7abf97..e05269252b71b57fd89f37700ced37da6b6a7bc3
@@@ -2080,35 -1297,17 +2080,31 @@@ test_util_parent_dir(void *ptr
      tor_free(cp);                               \
    } while (0);
  
 -  T("/home/wombat/knish", 0, "/home/wombat");
 -  T("/home/wombat/knish/", 0, "/home/wombat");
 -  T("/home", 0, "/");
 -  T("./home/wombat/knish/", 0, "./home/wombat");
 -  T("./wombat", 0, ".");
 +  T("/home/wombat", 0, "/home/wombat/knish");
 +  T("/home/wombat", 0, "/home/wombat/knish/");
 +  T("/home/wombat", 0, "/home/wombat/knish///");
 +  T("./home/wombat", 0, "./home/wombat/knish/");
- #if 0
 +  T("/", 0, "/home");
 +  T("/", 0, "/home//");
- #endif
 +  T(".", 0, "./wombat");
 +  T(".", 0, "./wombat/");
 +  T(".", 0, "./wombat//");
 +  T("wombat", 0, "wombat/foo");
 +  T("wombat/..", 0, "wombat/../foo");
 +  T("wombat/../", 0, "wombat/..//foo"); /* Is this correct? */
 +  T("wombat/.", 0, "wombat/./foo");
 +  T("wombat/./", 0, "wombat/.//foo"); /* Is this correct? */
 +  T("wombat", 0, "wombat/..//");
 +  T("wombat", 0, "wombat/foo/");
 +  T("wombat", 0, "wombat/.foo");
 +  T("wombat", 0, "wombat/.foo/");
 +
-   T("", -1, "");
-   T("", -1, ".");
-   T("", -1, "..");
-   T("", -1, "../");
-   T("", -1, "/");
-   T("", -1, "////");
-   T("", -1, "wombat");
-   T("", -1, "wombat/");
+   T("wombat", -1, "");
+   T("w", -1, "");
 -  T("wombat/knish", 0, "wombat");
 -  T("", -1, "");
++  T("wombat", 0, "wombat/knish");
++
+   T("/", 0, "/");
 -  T("////", 0, "/");
++  T("/", 0, "////");
  
   done:
    tor_free(cp);