539
696
{ "//server/share/", "//server/share" },
540
697
{ "//server/SHare/", "//server/SHare" },
541
698
{ "//SERVER/SHare/", "//server/SHare" },
542
#endif /* WIN32 or Cygwin */
699
{ "//srv/s r", "//srv/s r" },
700
{ "//srv/s r/qq", "//srv/s r/qq" },
701
#endif /* SVN_USE_DOS_PATHS */
546
*msg = "test svn_dirent_canonicalize";
550
for (i = 0; i < COUNT_OF(tests); i++)
704
for (t = tests; t < tests + COUNT_OF(tests); t++)
552
const char *canonical = svn_dirent_canonicalize(tests[i].path, pool);
706
const char *canonical = svn_dirent_canonicalize(t->path, pool);
554
if (strcmp(canonical, tests[i].result))
708
if (strcmp(canonical, t->result))
555
709
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
556
710
"svn_dirent_canonicalize(\"%s\") returned "
557
711
"\"%s\" expected \"%s\"",
558
tests[i].path, canonical, tests[i].result);
712
t->path, canonical, t->result);
561
715
return SVN_NO_ERROR;
564
718
static svn_error_t *
565
test_uri_canonicalize(const char **msg,
566
svn_boolean_t msg_only,
567
svn_test_opts_t *opts,
719
test_relpath_canonicalize(apr_pool_t *pool)
721
const testcase_canonicalize_t *t;
722
static const testcase_canonicalize_t tests[] = {
582
731
{ "./././.", "" },
583
{ "////././.", "/" },
584
733
{ "foo", "foo" },
585
734
{ ".foo", ".foo" },
586
735
{ "foo.", "foo." },
588
737
{ "foo/", "foo" },
589
738
{ "foo./", "foo." },
590
739
{ "foo./.", "foo." },
591
740
{ "foo././/.", "foo." },
592
{ "/foo/bar", "/foo/bar" },
741
{ "/foo/bar", "foo/bar" },
593
742
{ "foo/..", "foo/.." },
594
743
{ "foo/../", "foo/.." },
595
744
{ "foo/../.", "foo/.." },
596
745
{ "foo//.//bar", "foo/bar" },
597
{ "///foo", "/foo" },
598
{ "/.//./.foo", "/.foo" },
747
{ "/.//./.foo", ".foo" },
599
748
{ ".///.foo", ".foo" },
600
749
{ "../foo", "../foo" },
601
750
{ "../../foo/", "../../foo" },
602
751
{ "../../foo/..", "../../foo/.." },
603
{ "/../../", "/../.." },
752
{ "/../../", "../.." },
604
753
{ "X:/foo", "X:/foo" },
606
755
{ "X:foo", "X:foo" },
607
756
{ "C:/folder/subfolder/file", "C:/folder/subfolder/file" },
757
{ "http://hst", "http:/hst" },
758
{ "http://hst/foo/../bar","http:/hst/foo/../bar" },
759
{ "http://hst/", "http:/hst" },
760
{ "http:///", "http:" },
761
{ "https://", "https:" },
762
{ "file:///", "file:" },
763
{ "file://", "file:" },
764
{ "svn:///", "svn:" },
765
{ "svn+ssh:///", "svn+ssh:" },
766
{ "http://HST/", "http:/HST" },
767
{ "http://HST/FOO/BaR", "http:/HST/FOO/BaR" },
768
{ "svn+ssh://j.raNDom@HST/BaR", "svn+ssh:/j.raNDom@HST/BaR" },
769
{ "svn+SSH://j.random:jRaY@HST/BaR", "svn+SSH:/j.random:jRaY@HST/BaR" },
770
{ "SVN+ssh://j.raNDom:jray@HST/BaR", "SVN+ssh:/j.raNDom:jray@HST/BaR" },
771
{ "fILe:///Users/jrandom/wc", "fILe:/Users/jrandom/wc" },
772
{ "fiLE:///", "fiLE:" },
773
{ "fiLE://", "fiLE:" },
774
{ "file://SRV/shr/repos", "file:/SRV/shr/repos" },
775
{ "file://SRV/SHR/REPOS", "file:/SRV/SHR/REPOS" },
776
{ "http://server////", "http:/server" },
777
{ "http://server/file//", "http:/server/file" },
778
{ "http://server//.//f//", "http:/server/f" },
779
{ "file:///c:/temp/repos", "file:/c:/temp/repos" },
780
{ "file:///c:/temp/REPOS", "file:/c:/temp/REPOS" },
781
{ "file:///C:/temp/REPOS", "file:/C:/temp/REPOS" },
784
for (t = tests; t < tests + COUNT_OF(tests); t++)
786
const char *canonical = svn_relpath_canonicalize(t->path, pool);
788
if (strcmp(canonical, t->result))
789
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
790
"svn_relpath_canonicalize(\"%s\") returned "
791
"\"%s\" expected \"%s\"",
792
t->path, canonical, t->result);
798
static const testcase_canonicalize_t uri_canonical_tests[] =
608
800
{ "http://hst", "http://hst" },
609
801
{ "http://hst/foo/../bar","http://hst/foo/../bar" },
610
802
{ "http://hst/", "http://hst" },
616
808
{ "svn+ssh:///", "svn+ssh://" },
617
809
{ "http://HST/", "http://hst" },
618
810
{ "http://HST/FOO/BaR", "http://hst/FOO/BaR" },
811
{ "svn+ssh://jens@10.0.1.1", "svn+ssh://jens@10.0.1.1" },
619
812
{ "svn+ssh://j.raNDom@HST/BaR", "svn+ssh://j.raNDom@hst/BaR" },
620
813
{ "svn+SSH://j.random:jRaY@HST/BaR", "svn+ssh://j.random:jRaY@hst/BaR" },
621
814
{ "SVN+ssh://j.raNDom:jray@HST/BaR", "svn+ssh://j.raNDom:jray@hst/BaR" },
815
{ "svn+ssh://j.raNDom:jray@hst/BaR", "svn+ssh://j.raNDom:jray@hst/BaR" },
622
816
{ "fILe:///Users/jrandom/wc", "file:///Users/jrandom/wc" },
623
817
{ "fiLE:///", "file://" },
624
818
{ "fiLE://", "file://" },
625
819
{ "file://SRV/shr/repos", "file://srv/shr/repos" },
626
820
{ "file://SRV/SHR/REPOS", "file://srv/SHR/REPOS" },
627
#if defined(WIN32) || defined(__CYGWIN__)
821
{ "http://server////", "http://server" },
822
{ "http://server/file//", "http://server/file" },
823
{ "http://server//.//f//", "http://server/f" },
824
{ "http://server/d/.", "http://server/d" },
825
{ "http://server/d/%2E", "http://server/d" },
826
{ "http://server/d/./q", "http://server/d/q" },
827
{ "http://server/d/%2E/q", "http://server/d/q" },
828
{ "http://server/%", "http://server/%25" },
829
{ "http://server/%25", "http://server/%25" },
830
{ "http://server/%/d", "http://server/%25/d" },
831
{ "http://server/%25/d", "http://server/%25/d" },
832
{ "http://server/+", "http://server/+" },
833
{ "http://server/%2B", "http://server/+" },
834
{ "http://server/ ", "http://server/%20" },
835
{ "http://server/#", "http://server/%23" },
836
{ "http://server/d/a%2Fb", "http://server/d/a/b" },
837
{ "http://server/d/.%2F.", "http://server/d" },
838
{ "http://server/d/%2E%2F%2E", "http://server/d" },
839
{ "file:///C%3a/temp", "file:///C:/temp" },
840
{ "http://server/cr%AB", "http://server/cr%AB" },
841
{ "http://server/cr%ab", "http://server/cr%AB" },
842
{ "http://hst/foo/bar/", "http://hst/foo/bar" },
843
{ "http://hst/foo/.", "http://hst/foo" },
844
{ "http://hst/foo/%2E", "http://hst/foo" },
845
{ "http://hst/%", "http://hst/%25" },
846
{ "http://hst/+", "http://hst/+" },
847
{ "http://hst/#", "http://hst/%23" },
848
{ "http://hst/ ", "http://hst/%20" },
849
{ "http://hst/%2B", "http://hst/+" },
850
{ "http://HST", "http://hst" },
851
{ "http://hst/foo/./bar", "http://hst/foo/bar" },
852
{ "hTTp://hst/foo/bar", "http://hst/foo/bar" },
853
{ "http://hst/foo/bar/", "http://hst/foo/bar" },
854
{ "file://SRV/share/repo", "file://srv/share/repo" },
855
{ "file://srv/SHARE/repo", "file://srv/SHARE/repo" },
856
{ "file://srv/share/repo", "file://srv/share/repo" },
857
{ "file://srv/share/repo/","file://srv/share/repo" },
858
{ "file:///folder/c#", "file:///folder/c%23" }, /* # needs escaping */
859
{ "file:///fld/with space","file:///fld/with%20space" }, /* # needs escaping */
860
{ "file:///fld/c%23", "file:///fld/c%23" }, /* Properly escaped C# */
861
{ "file:///%DE%AD%BE%EF", "file:///%DE%AD%BE%EF" },
862
{ "file:///%de%ad%be%ef", "file:///%DE%AD%BE%EF" },
863
{ "file:///%DE%ad%BE%ef", "file:///%DE%AD%BE%EF" },
864
/* With default port number; these are non-canonical */
865
{ "http://server:", "http://server" },
866
{ "http://server:/", "http://server" },
867
{ "http://server:80", "http://server" },
868
{ "http://SERVER:80", "http://server" },
869
{ "http://server:80/", "http://server" },
870
{ "http://server:80/p", "http://server/p" },
871
{ "https://server:", "https://server" },
872
{ "https://Server:443/q", "https://server/q" },
873
{ "svn://server:3690/", "svn://server" },
874
{ "svn://sERVER:3690/r", "svn://server/r" },
875
{ "svn://server:/r", "svn://server/r" },
876
/* With non-default port number; both canonical and non-c. examples */
877
{ "http://server:1", "http://server:1" },
878
{ "http://server:443", "http://server:443" },
879
{ "http://server:81/", "http://server:81" },
880
{ "http://SERVER:3690/", "http://server:3690" },
881
{ "https://server:3690", "https://server:3690" },
882
{ "https://SERVER:80/", "https://server:80" },
883
{ "svn://server:80", "svn://server:80" },
884
{ "svn://SERVER:443/", "svn://server:443" },
885
#ifdef SVN_USE_DOS_PATHS
628
886
{ "file:///c:/temp/repos", "file:///C:/temp/repos" },
629
887
{ "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
630
888
{ "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
631
#else /* WIN32 or Cygwin */
889
#else /* !SVN_USE_DOS_PATHS */
632
890
{ "file:///c:/temp/repos", "file:///c:/temp/repos" },
633
891
{ "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
634
892
{ "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
635
#endif /* non-WIN32 */
893
#endif /* SVN_USE_DOS_PATHS */
894
/* svn_uri_is_canonical() was a private function in the 1.6 API, and
895
has since taken a MAJOR change of direction, namely that only
896
absolute URLs are considered canonical uris now. */
906
{ "////././.", NULL },
914
{ "foo././/.", NULL },
915
{ "/foo/bar", NULL },
918
{ "foo/../.", NULL },
919
{ "foo//.//bar", NULL },
921
{ "/.//./.foo", NULL },
922
{ ".///.foo", NULL },
924
{ "../../foo/", NULL },
925
{ "../../foo/..", NULL },
928
{ "foo/dirA", NULL },
929
{ "foo/./bar", NULL },
930
{ "C:/folder/subfolder/file", NULL },
935
/* Some people use colons in their filenames. */
939
{ "//server/share", NULL }, /* Only valid as dirent */
940
{ "//server", NULL },
942
{ "sch://@/", NULL },
639
*msg = "test svn_uri_canonicalize";
643
for (i = 0; i < COUNT_OF(tests); i++)
948
test_uri_canonicalize(apr_pool_t *pool)
950
const testcase_canonicalize_t *t;
952
for (t = uri_canonical_tests;
953
t < uri_canonical_tests + COUNT_OF(uri_canonical_tests);
646
const char *canonical = svn_uri_canonicalize(tests[i].path, pool);
648
if (strcmp(canonical, tests[i].result))
956
const char *canonical;
961
canonical = svn_uri_canonicalize(t->path, pool);
963
if (strcmp(canonical, t->result))
649
964
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
650
965
"svn_uri_canonicalize(\"%s\") returned "
651
966
"\"%s\" expected \"%s\"",
652
tests[i].path, canonical, tests[i].result);
967
t->path, canonical, t->result);
655
970
return SVN_NO_ERROR;
973
/* Paths to test and the expected result, for is_canonical tests. */
974
typedef struct testcase_is_canonical_t {
976
svn_boolean_t canonical;
977
} testcase_is_canonical_t;
658
979
static svn_error_t *
659
test_dirent_is_canonical(const char **msg,
660
svn_boolean_t msg_only,
661
svn_test_opts_t *opts,
980
test_dirent_is_canonical(apr_pool_t *pool)
666
svn_boolean_t canonical;
982
const testcase_is_canonical_t *t;
983
static const testcase_is_canonical_t tests[] = {
874
1171
static svn_error_t *
875
test_dirent_is_ancestor(const char **msg,
876
svn_boolean_t msg_only,
877
svn_test_opts_t *opts,
882
/* Dirents to test and their expected results. */
886
svn_boolean_t result;
888
{ "/foo", "/foo/bar", TRUE},
889
{ "/foo/bar", "/foo/bar/", TRUE},
890
{ "/", "/foo", TRUE},
891
{ SVN_EMPTY_PATH, "foo", TRUE},
892
{ SVN_EMPTY_PATH, ".bar", TRUE},
893
{ SVN_EMPTY_PATH, "/", FALSE},
894
{ SVN_EMPTY_PATH, "/foo", FALSE},
895
{ "/.bar", "/", FALSE},
896
{ "foo/bar", "foo", FALSE},
897
{ "/foo/bar", "/foo", FALSE},
898
{ "foo", "foo/bar", TRUE},
899
{ "foo.", "foo./.bar", TRUE},
901
{ "../foo", "..", FALSE},
902
{ SVN_EMPTY_PATH, SVN_EMPTY_PATH, TRUE},
904
{ "X:foo", "X:bar", FALSE},
905
#if defined(WIN32) || defined(__CYGWIN__)
906
{ "//srv/shr", "//srv", FALSE},
907
{ "//srv/shr", "//srv/shr/fld", TRUE },
908
{ "//srv", "//srv/shr/fld", TRUE },
909
{ "//srv/shr/fld", "//srv/shr", FALSE },
910
{ "//srv/shr/fld", "//srv2/shr/fld", FALSE },
911
{ "X:/", "X:/", TRUE},
912
{ "X:/foo", "X:/", FALSE},
913
{ "X:/", "X:/foo", TRUE},
914
{ "X:", "X:foo", TRUE},
915
{ SVN_EMPTY_PATH, "C:/", FALSE},
916
#else /* WIN32 or Cygwin */
917
{ "X:", "X:foo", FALSE},
918
{ SVN_EMPTY_PATH, "C:/", TRUE},
919
#endif /* non-WIN32 */
922
*msg = "test svn_dirent_is_ancestor";
927
for (i = 0; i < COUNT_OF(tests); i++)
1172
test_uri_is_canonical(apr_pool_t *pool)
1174
const testcase_canonicalize_t *t;
1176
for (t = uri_canonical_tests;
1177
t < uri_canonical_tests + COUNT_OF(uri_canonical_tests);
1180
svn_boolean_t canonical;
1182
canonical = svn_uri_is_canonical(t->path, pool);
1183
if (canonical != (t->result && strcmp(t->path, t->result) == 0))
1184
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
1185
"svn_uri_is_canonical(\"%s\") returned "
1186
"\"%s\"; canonical form is \"%s\"",
1188
canonical ? "TRUE" : "FALSE",
1192
return SVN_NO_ERROR;
1195
static svn_error_t *
1196
test_dirent_split(apr_pool_t *pool)
1200
static const char * const paths[][3] = {
1201
{ "/foo/bar", "/foo", "bar" },
1202
{ "/foo/bar/ ", "/foo/bar", " " },
1203
{ "/foo", "/", "foo" },
1204
{ "foo", SVN_EMPTY_PATH, "foo" },
1205
{ ".bar", SVN_EMPTY_PATH, ".bar" },
1206
{ "/.bar", "/", ".bar" },
1207
{ "foo/bar", "foo", "bar" },
1208
{ "/foo/bar", "/foo", "bar" },
1209
{ "foo/bar", "foo", "bar" },
1210
{ "foo./.bar", "foo.", ".bar" },
1211
{ "../foo", "..", "foo" },
1212
{ SVN_EMPTY_PATH, SVN_EMPTY_PATH, SVN_EMPTY_PATH },
1213
{ "/flu\\b/\\blarg", "/flu\\b", "\\blarg" },
1215
{ "X:/foo/bar", "X:/foo", "bar" },
1216
{ "X:foo/bar", "X:foo", "bar" },
1217
#ifdef SVN_USE_DOS_PATHS
1218
{ "X:/", "X:/", "" },
1219
{ "X:/foo", "X:/", "foo" },
1220
{ "X:foo", "X:", "foo" },
1221
{ "//srv/shr", "//srv/shr", "" },
1222
{ "//srv/shr/fld", "//srv/shr", "fld" },
1223
{ "//srv/s r", "//srv/s r", "" },
1224
#else /* !SVN_USE_DOS_PATHS */
1225
{ "X:foo", SVN_EMPTY_PATH, "X:foo" },
1226
#endif /* SVN_USE_DOS_PATHS */
1229
for (i = 0; i < COUNT_OF(paths); i++)
1231
const char *dir, *base_name;
1233
svn_dirent_split(&dir, &base_name, paths[i][0], pool);
1234
if (strcmp(dir, paths[i][1]))
1236
return svn_error_createf
1237
(SVN_ERR_TEST_FAILED, NULL,
1238
"svn_dirent_split (%s) returned dirname '%s' instead of '%s'",
1239
paths[i][0], dir, paths[i][1]);
1241
if (strcmp(base_name, paths[i][2]))
1243
return svn_error_createf
1244
(SVN_ERR_TEST_FAILED, NULL,
1245
"svn_dirent_split (%s) returned basename '%s' instead of '%s'",
1246
paths[i][0], base_name, paths[i][2]);
1249
return SVN_NO_ERROR;
1252
static svn_error_t *
1253
test_relpath_split(apr_pool_t *pool)
1257
static const char * const paths[][3] = {
1259
{ "bar", "", "bar" },
1260
{ "foo/bar", "foo", "bar" },
1261
{ "a/b/c", "a/b", "c" },
1264
for (i = 0; i < COUNT_OF(paths); i++)
1266
const char *dir, *base_name;
1268
svn_relpath_split( &dir, &base_name, paths[i][0], pool);
1269
if (strcmp(dir, paths[i][1]))
1271
return svn_error_createf
1272
(SVN_ERR_TEST_FAILED, NULL,
1273
"svn_relpath_split (%s) returned dirname '%s' instead of '%s'",
1274
paths[i][0], dir, paths[i][1]);
1276
if (strcmp(base_name, paths[i][2]))
1278
return svn_error_createf
1279
(SVN_ERR_TEST_FAILED, NULL,
1280
"svn_relpath_split (%s) returned basename '%s' instead of '%s'",
1281
paths[i][0], base_name, paths[i][2]);
1284
return SVN_NO_ERROR;
1288
static svn_error_t *
1289
test_uri_split(apr_pool_t *pool)
1293
static const char * const paths[][3] = {
1294
{ "http://server/foo/bar", "http://server/foo", "bar" },
1295
{ "http://server/dir/foo/bar", "http://server/dir/foo", "bar" },
1296
{ "http://server/some%20dir/foo%20bar", "http://server/some%20dir", "foo bar" },
1297
{ "http://server/foo", "http://server", "foo" },
1298
{ "http://server", "http://server", "" },
1299
{ "file://", "file://", "" },
1300
{ "file:///a", "file://", "a" }
1303
for (i = 0; i < COUNT_OF(paths); i++)
1305
const char *dir, *base_name;
1307
svn_uri_split(&dir, &base_name, paths[i][0], pool);
1308
if (strcmp(dir, paths[i][1]))
1310
return svn_error_createf
1311
(SVN_ERR_TEST_FAILED, NULL,
1312
"svn_uri_split (%s) returned dirname '%s' instead of '%s'",
1313
paths[i][0], dir, paths[i][1]);
1315
if (strcmp(base_name, paths[i][2]))
1317
return svn_error_createf
1318
(SVN_ERR_TEST_FAILED, NULL,
1319
"svn_uri_split (%s) returned basename '%s' instead of '%s'",
1320
paths[i][0], base_name, paths[i][2]);
1323
return SVN_NO_ERROR;
1326
/* Paths to test and the expected result, for ancestor tests. */
1327
typedef struct testcase_ancestor_t {
1331
} testcase_ancestor_t;
1333
static const testcase_ancestor_t dirent_ancestor_tests[] =
1336
{ "", "foo", "foo" },
1337
{ "", ".bar", ".bar" },
1339
{ "", "/foo", NULL },
1341
{ "/", "foo", NULL },
1343
{ "/", "/foo", "foo" },
1344
{ "/", "bar/bla", NULL },
1345
{ "/foo", "/foo", "" },
1346
{ "/foo", "/foot", NULL },
1347
{ "/foo", "/foo/bar", "bar" },
1348
{ "/foo/bar", "/foot/bar", NULL },
1349
{ "/foot", "/foo", NULL },
1350
{ "/foo/bar/bla", "/foo/bar", NULL },
1351
{ "/foo/bar", "/foo/bar/bla", "bla" },
1352
{ "foo/bar", "foo", NULL },
1353
{ "/foo/bar", "foo", NULL },
1354
{ "/.bar", "/", NULL },
1355
{ "/foo/bar", "/foo", NULL },
1356
{ "foo", "foo/bar", "bar" },
1357
{ "foo.", "foo./.bar", ".bar" },
1358
{ "X:foo", "X:bar", NULL },
1359
{ "../foo", "..", NULL },
1360
#ifdef SVN_USE_DOS_PATHS
1362
{ "", "C:foo", NULL },
1363
{ "", "C:/", NULL },
1364
{ "", "C:/foo", NULL },
1365
{ "X", "X:", NULL },
1366
{ "X", "X:foo", NULL },
1367
{ "X", "X:/", NULL },
1368
{ "X", "X:/foo", NULL },
1370
{ "X:", "X:foo", "foo" },
1371
{ "X:", "X:/", NULL },
1372
{ "X:", "X:/foo", NULL },
1373
{ "X:/", "X:", NULL },
1374
{ "X:/", "X:foo", NULL },
1375
{ "X:/", "X:/", "" },
1376
{ "X:/", "X:/foo", "foo" },
1377
{ "X:/foo", "X:/", NULL },
1378
{ "A:/foo", "A:/foo/bar", "bar" },
1379
{ "A:/foo", "A:/foot", NULL },
1380
{ "//srv", "//srv/share", NULL },
1381
{ "//srv", "//srv/shr/fld", NULL },
1382
{ "//srv/shr", "//srv", NULL },
1383
{ "//srv/share", "//vrs/share", NULL },
1384
{ "//srv/share", "//srv/share/foo", "foo" },
1385
{ "//srv/shr", "//srv/shr/fld", "fld" },
1386
{ "//srv/s r", "//srv/s r/fld", "fld" },
1387
{ "//srv/shr/fld", "//srv/shr", NULL },
1388
{ "//srv/shr/fld", "//srv2/shr/fld", NULL },
1389
{ "/", "//srv/share", NULL },
1390
#else /* !SVN_USE_DOS_PATHS */
1392
{ "", "C:/foo", "C:/foo" },
1393
{ "X:", "X:foo", NULL },
1397
static svn_error_t *
1398
test_dirent_is_ancestor(apr_pool_t *pool)
1400
const testcase_ancestor_t *t;
1402
for (t = dirent_ancestor_tests;
1403
t < dirent_ancestor_tests + COUNT_OF(dirent_ancestor_tests);
929
1406
svn_boolean_t retval;
931
retval = svn_dirent_is_ancestor(tests[i].path1, tests[i].path2);
932
if (tests[i].result != retval)
1408
retval = svn_dirent_is_ancestor(t->path1, t->path2);
1409
if (!!t->result != retval)
933
1410
return svn_error_createf
934
1411
(SVN_ERR_TEST_FAILED, NULL,
935
1412
"svn_dirent_is_ancestor (%s, %s) returned %s instead of %s",
936
tests[i].path1, tests[i].path2, retval ? "TRUE" : "FALSE",
937
tests[i].result ? "TRUE" : "FALSE");
943
test_uri_is_ancestor(const char **msg,
944
svn_boolean_t msg_only,
945
svn_test_opts_t *opts,
950
/* URIs to test and their expected results. */
954
svn_boolean_t result;
956
{ "/foo", "/foo/bar", TRUE},
957
{ "/foo/bar", "/foo/bar/", TRUE},
958
{ "/", "/foo", TRUE},
959
{ SVN_EMPTY_PATH, "foo", TRUE},
960
{ SVN_EMPTY_PATH, ".bar", TRUE},
961
{ SVN_EMPTY_PATH, "/", FALSE},
962
{ SVN_EMPTY_PATH, "/foo", FALSE},
963
{ "/.bar", "/", FALSE},
964
{ "foo/bar", "foo", FALSE},
965
{ "/foo/bar", "/foo", FALSE},
966
{ "foo", "foo/bar", TRUE},
967
{ "foo.", "foo./.bar", TRUE},
969
{ "../foo", "..", FALSE},
970
{ SVN_EMPTY_PATH, SVN_EMPTY_PATH, TRUE},
973
{ "http://test", "http://test", TRUE},
974
{ "http://test", "http://taste", FALSE},
975
{ "http://test", "http://test/foo", TRUE},
976
{ "http://test", "file://test/foo", FALSE},
977
{ "http://test", "http://testF", FALSE},
978
{ "http://", "http://test", TRUE},
979
{ SVN_EMPTY_PATH, "http://test", FALSE},
980
{ "X:foo", "X:bar", FALSE},
981
{ "X:", "X:foo", FALSE},
984
*msg = "test svn_uri_is_ancestor";
989
for (i = 0; i < COUNT_OF(tests); i++)
991
svn_boolean_t retval;
993
retval = svn_uri_is_ancestor(tests[i].path1, tests[i].path2);
994
if (tests[i].result != retval)
1413
t->path1, t->path2, retval ? "TRUE" : "FALSE",
1414
t->result ? "TRUE" : "FALSE");
1416
return SVN_NO_ERROR;
1419
static const testcase_ancestor_t relpath_ancestor_tests[] =
1422
{ "", "foo", "foo" },
1423
{ "", ".bar", ".bar" },
1424
{ "", "bar/bla", "bar/bla" },
1425
{ "foo", "foo", "" },
1426
{ "foo", "foo/bar", "bar" },
1427
{ "foo", "foot", NULL },
1428
{ "foo.", "foo./.bar", ".bar" },
1429
{ "foot", "foo", NULL },
1430
{ "foo/bar", "foo", NULL },
1431
{ "foo/bar", "foo/bar/bla", "bla" },
1432
{ "foo/bar", "foot/bar", NULL },
1433
{ "foo/bar/bla", "foo/bar", NULL },
1434
{ "food/bar", "foo/bar", NULL },
1435
{ "http:/server", "http:/server/q", "q" },
1436
{ "svn:/server", "http:/server/q", NULL },
1437
/* These are relpaths so a colon is not special. */
1439
{ "X:", "X:foo", NULL },
1440
{ "X:", "X:/foo", "foo" },
1441
{ "X:foo", "X:bar", NULL },
1444
static svn_error_t *
1445
test_relpath_is_ancestor(apr_pool_t *pool)
1447
const testcase_ancestor_t *t;
1449
for (t = relpath_ancestor_tests;
1450
t < relpath_ancestor_tests + COUNT_OF(relpath_ancestor_tests);
1453
svn_boolean_t retval;
1455
retval = svn_relpath__is_ancestor(t->path1, t->path2);
1456
if (!!t->result != retval)
1457
return svn_error_createf
1458
(SVN_ERR_TEST_FAILED, NULL,
1459
"svn_relpath_is_ancestor (%s, %s) returned %s instead of %s",
1460
t->path1, t->path2, retval ? "TRUE" : "FALSE",
1461
t->result ? "TRUE" : "FALSE");
1463
return SVN_NO_ERROR;
1466
static const testcase_ancestor_t uri_ancestor_tests[] =
1468
{ "http://test", "http://test", "" },
1469
{ "http://test", "http://taste", NULL },
1470
{ "http://test", "http://test/foo", "foo" },
1471
{ "http://test", "file://test/foo", NULL },
1472
{ "http://test", "http://testf", NULL },
1473
{ "http://", "http://test", NULL },
1474
{ "http://server", "http://server/q", "q" },
1475
{ "svn://server", "http://server/q", NULL },
1478
static svn_error_t *
1479
test_uri_is_ancestor(apr_pool_t *pool)
1481
const testcase_ancestor_t *t;
1483
for (t = uri_ancestor_tests;
1484
t < uri_ancestor_tests + COUNT_OF(uri_ancestor_tests);
1487
svn_boolean_t retval;
1489
retval = svn_uri__is_ancestor(t->path1, t->path2);
1490
if (!!t->result != retval)
995
1491
return svn_error_createf
996
1492
(SVN_ERR_TEST_FAILED, NULL,
997
1493
"svn_uri_is_ancestor (%s, %s) returned %s instead of %s",
998
tests[i].path1, tests[i].path2, retval ? "TRUE" : "FALSE",
999
tests[i].result ? "TRUE" : "FALSE");
1001
return SVN_NO_ERROR;
1004
static svn_error_t *
1005
test_dirent_get_longest_ancestor(const char **msg,
1006
svn_boolean_t msg_only,
1007
svn_test_opts_t *opts,
1012
/* Paths to test and their expected results. */
1494
t->path1, t->path2, retval ? "TRUE" : "FALSE",
1495
t->result ? "TRUE" : "FALSE");
1497
return SVN_NO_ERROR;
1500
static svn_error_t *
1501
test_dirent_skip_ancestor(apr_pool_t *pool)
1503
const testcase_ancestor_t *t;
1505
for (t = dirent_ancestor_tests;
1506
t < dirent_ancestor_tests + COUNT_OF(dirent_ancestor_tests);
1511
retval = svn_dirent_skip_ancestor(t->path1, t->path2);
1512
if ((t->result == NULL)
1514
: (retval == NULL || strcmp(t->result, retval) != 0))
1515
return svn_error_createf(
1516
SVN_ERR_TEST_FAILED, NULL,
1517
"svn_dirent_skip_ancestor (%s, %s) returned %s instead of %s",
1518
t->path1, t->path2, retval, t->result);
1520
return SVN_NO_ERROR;
1523
static svn_error_t *
1524
test_relpath_skip_ancestor(apr_pool_t *pool)
1526
const testcase_ancestor_t *t;
1528
for (t = relpath_ancestor_tests;
1529
t < relpath_ancestor_tests + COUNT_OF(relpath_ancestor_tests);
1534
retval = svn_relpath_skip_ancestor(t->path1, t->path2);
1535
if ((t->result == NULL)
1537
: (retval == NULL || strcmp(t->result, retval) != 0))
1538
return svn_error_createf(
1539
SVN_ERR_TEST_FAILED, NULL,
1540
"svn_relpath_skip_ancestor (%s, %s) returned %s instead of %s",
1541
t->path1, t->path2, retval, t->result);
1543
return SVN_NO_ERROR;
1546
static svn_error_t *
1547
test_uri_skip_ancestor(apr_pool_t *pool)
1549
const testcase_ancestor_t *t;
1551
for (t = uri_ancestor_tests;
1552
t < uri_ancestor_tests + COUNT_OF(uri_ancestor_tests);
1557
retval = svn_uri_skip_ancestor(t->path1, t->path2, pool);
1558
if ((t->result == NULL)
1560
: (retval == NULL || strcmp(t->result, retval) != 0))
1561
return svn_error_createf(
1562
SVN_ERR_TEST_FAILED, NULL,
1563
"svn_uri_skip_ancestor (%s, %s) returned %s instead of %s",
1564
t->path1, t->path2, retval, t->result);
1566
return SVN_NO_ERROR;
1569
/* Paths to test and the expected result, for get_longest_ancestor tests. */
1570
typedef struct testcase_get_longest_ancestor_t {
1574
} testcase_get_longest_ancestor_t;
1576
static svn_error_t *
1577
test_dirent_get_longest_ancestor(apr_pool_t *pool)
1579
const testcase_get_longest_ancestor_t *t;
1580
static const testcase_get_longest_ancestor_t tests[] = {
1018
1581
{ "/foo", "/foo/bar", "/foo"},
1019
1582
{ "/foo/bar", "foo/bar", SVN_EMPTY_PATH},
1020
1583
{ "/", "/foo", "/"},
1045
1608
{ "X:", "X:foo", "X:"},
1046
1609
{ "X:", "X:/", SVN_EMPTY_PATH},
1047
1610
{ "X:foo", "X:bar", "X:"},
1048
#else /* WIN32 or Cygwin */
1611
#else /* !SVN_USE_DOS_PATHS */
1049
1612
{ "X:/foo", "X:", "X:"},
1050
1613
{ "X:/folder1", "X:/folder2", "X:"},
1051
1614
{ "X:", "X:foo", SVN_EMPTY_PATH},
1052
1615
{ "X:foo", "X:bar", SVN_EMPTY_PATH},
1053
#endif /* non-WIN32 */
1616
#endif /* SVN_USE_DOS_PATHS */
1056
*msg = "test svn_dirent_get_longest_ancestor";
1059
return SVN_NO_ERROR;
1061
for (i = 0; i < COUNT_OF(tests); i++)
1619
for (t = tests; t < tests + COUNT_OF(tests); t++)
1063
1621
const char *retval;
1065
retval = svn_dirent_get_longest_ancestor(tests[i].path1, tests[i].path2,
1623
retval = svn_dirent_get_longest_ancestor(t->path1, t->path2, pool);
1068
if (strcmp(tests[i].result, retval))
1625
if (strcmp(t->result, retval))
1069
1626
return svn_error_createf
1070
1627
(SVN_ERR_TEST_FAILED, NULL,
1071
1628
"svn_dirent_get_longest_ancestor (%s, %s) returned %s instead of %s",
1072
tests[i].path1, tests[i].path2, retval, tests[i].result);
1629
t->path1, t->path2, retval, t->result);
1074
1631
/* changing the order of the paths should return the same results */
1075
retval = svn_dirent_get_longest_ancestor(tests[i].path2, tests[i].path1,
1632
retval = svn_dirent_get_longest_ancestor(t->path2, t->path1, pool);
1078
if (strcmp(tests[i].result, retval))
1634
if (strcmp(t->result, retval))
1079
1635
return svn_error_createf
1080
1636
(SVN_ERR_TEST_FAILED, NULL,
1081
1637
"svn_dirent_get_longest_ancestor (%s, %s) returned %s instead of %s",
1082
tests[i].path2, tests[i].path1, retval, tests[i].result);
1638
t->path2, t->path1, retval, t->result);
1084
1640
return SVN_NO_ERROR;
1087
1643
static svn_error_t *
1088
test_uri_get_longest_ancestor(const char **msg,
1089
svn_boolean_t msg_only,
1090
svn_test_opts_t *opts,
1644
test_relpath_get_longest_ancestor(apr_pool_t *pool)
1095
/* Paths to test and their expected results. */
1101
{ "/foo", "/foo/bar", "/foo"},
1102
{ "/foo/bar", "foo/bar", SVN_EMPTY_PATH},
1103
{ "/", "/foo", "/"},
1104
{ SVN_EMPTY_PATH, "foo", SVN_EMPTY_PATH},
1105
{ SVN_EMPTY_PATH, ".bar", SVN_EMPTY_PATH},
1106
{ "/.bar", "/", "/"},
1107
{ "foo/bar", "foo", "foo"},
1108
{ "/foo/bar", "/foo", "/foo"},
1109
{ "/rif", "/raf", "/"},
1110
{ "foo", "bar", SVN_EMPTY_PATH},
1646
const testcase_get_longest_ancestor_t *t;
1647
static const testcase_get_longest_ancestor_t tests[] = {
1648
{ "foo", "foo/bar", "foo"},
1649
{ "foo/bar", "foo/bar", "foo/bar"},
1654
{ "foo/bar", "foo", "foo"},
1655
{ "foo/bar", "foo", "foo"},
1656
{ "rif", "raf", ""},
1657
{ "foo", "bar", ""},
1111
1658
{ "foo", "foo/bar", "foo"},
1112
1659
{ "foo.", "foo./.bar", "foo."},
1113
{ SVN_EMPTY_PATH, SVN_EMPTY_PATH, SVN_EMPTY_PATH},
1661
{ "http:/test", "http:/test", "http:/test"},
1662
{ "http:/test", "http:/taste", "http:"},
1663
{ "http:/test", "http:/test/foo", "http:/test"},
1664
{ "http:/test", "file:/test/foo", ""},
1665
{ "http:/test", "http:/testF", "http:"},
1666
{ "file:/A/C", "file:/B/D", "file:"},
1667
{ "file:/A/C", "file:/A/D", "file:/A"},
1668
{ "X:/foo", "X:", "X:"},
1669
{ "X:/folder1", "X:/folder2", "X:"},
1670
{ "X:", "X:foo", ""},
1671
{ "X:foo", "X:bar", ""},
1674
for (t = tests; t < tests + COUNT_OF(tests); t++)
1678
retval = svn_relpath_get_longest_ancestor(t->path1, t->path2, pool);
1680
if (strcmp(t->result, retval))
1681
return svn_error_createf
1682
(SVN_ERR_TEST_FAILED, NULL,
1683
"svn_relpath_get_longest_ancestor (%s, %s) returned "
1685
t->path1, t->path2, retval, t->result);
1687
/* changing the order of the paths should return the same results */
1688
retval = svn_relpath_get_longest_ancestor(t->path2, t->path1, pool);
1690
if (strcmp(t->result, retval))
1691
return svn_error_createf
1692
(SVN_ERR_TEST_FAILED, NULL,
1693
"svn_relpath_get_longest_ancestor (%s, %s) returned "
1695
t->path2, t->path1, retval, t->result);
1697
return SVN_NO_ERROR;
1700
static svn_error_t *
1701
test_uri_get_longest_ancestor(apr_pool_t *pool)
1703
const testcase_get_longest_ancestor_t *t;
1704
static const testcase_get_longest_ancestor_t tests[] = {
1115
1705
{ "http://test", "http://test", "http://test"},
1116
1706
{ "http://test", "http://taste", SVN_EMPTY_PATH},
1117
1707
{ "http://test", "http://test/foo", "http://test"},
1118
1708
{ "http://test", "file://test/foo", SVN_EMPTY_PATH},
1119
{ "http://test", "http://testF", SVN_EMPTY_PATH},
1709
{ "http://test", "http://testf", SVN_EMPTY_PATH},
1120
1710
{ "http://", "http://test", SVN_EMPTY_PATH},
1121
1711
{ "file:///A/C", "file:///B/D", SVN_EMPTY_PATH},
1122
1712
{ "file:///A/C", "file:///A/D", "file:///A"},
1123
{ "X:/foo", "X:", "X:"},
1124
{ "X:/folder1", "X:/folder2", "X:"},
1125
{ "X:", "X:foo", SVN_EMPTY_PATH},
1126
{ "X:foo", "X:bar", SVN_EMPTY_PATH},
1129
*msg = "test svn_uri_get_longest_ancestor";
1132
return SVN_NO_ERROR;
1134
for (i = 0; i < COUNT_OF(tests); i++)
1715
for (t = tests; t < tests + COUNT_OF(tests); t++)
1136
1717
const char *retval;
1138
retval = svn_uri_get_longest_ancestor(tests[i].path1, tests[i].path2,
1719
retval = svn_uri_get_longest_ancestor(t->path1, t->path2, pool);
1141
if (strcmp(tests[i].result, retval))
1721
if (strcmp(t->result, retval))
1142
1722
return svn_error_createf
1143
1723
(SVN_ERR_TEST_FAILED, NULL,
1144
1724
"svn_uri_get_longest_ancestor (%s, %s) returned %s instead of %s",
1145
tests[i].path1, tests[i].path2, retval, tests[i].result);
1725
t->path1, t->path2, retval, t->result);
1147
1727
/* changing the order of the paths should return the same results */
1148
retval = svn_uri_get_longest_ancestor(tests[i].path2, tests[i].path1,
1728
retval = svn_uri_get_longest_ancestor(t->path2, t->path1, pool);
1151
if (strcmp(tests[i].result, retval))
1730
if (strcmp(t->result, retval))
1152
1731
return svn_error_createf
1153
1732
(SVN_ERR_TEST_FAILED, NULL,
1154
1733
"svn_uri_get_longest_ancestor (%s, %s) returned %s instead of %s",
1155
tests[i].path2, tests[i].path1, retval, tests[i].result);
1734
t->path2, t->path1, retval, t->result);
1157
1736
return SVN_NO_ERROR;
1160
1739
static svn_error_t *
1161
test_dirent_is_child(const char **msg,
1162
svn_boolean_t msg_only,
1163
svn_test_opts_t *opts,
1740
test_dirent_is_child(apr_pool_t *pool)
1291
1862
static svn_error_t *
1292
test_uri_is_child(const char **msg,
1293
svn_boolean_t msg_only,
1294
svn_test_opts_t *opts,
1863
test_relpath_is_child(apr_pool_t *pool)
1299
#define NUM_TEST_PATHS 16
1301
1867
static const char * const paths[] = {
1307
"/foo/bar/baz/bing/boom",
1875
"foo/bar/baz/bing/boom",
1886
/* Maximum number of path[] items for all platforms */
1887
#define MAX_PATHS 32
1889
static const char * const
1890
remainders[COUNT_OF(paths)][MAX_PATHS] = {
1891
{ 0, "foo", "foo/bar", "foo/bars", "foo/baz", "foo/bar/baz",
1892
"flu/blar/blaz", "foo/bar/baz/bing/boom", ".foo", ":", "foo2", "food",
1893
"bar", "baz", "ba", "bad" },
1894
{ 0, 0, "bar", "bars", "baz", "bar/baz", 0, "bar/baz/bing/boom", 0, 0, 0,
1896
{ 0, 0, 0, 0, 0, "baz", 0, "baz/bing/boom", 0, 0, 0, 0, 0, 0, 0, 0 },
1897
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1898
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1899
{ 0, 0, 0, 0, 0, 0, 0, "bing/boom", 0, 0, 0, 0, 0, 0, 0, 0 },
1900
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1901
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1902
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1903
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1904
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1905
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1906
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1907
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1908
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1911
for (i = 0; i < COUNT_OF(paths); i++)
1913
for (j = 0; j < COUNT_OF(paths); j++)
1915
const char *remainder;
1917
remainder = svn_dirent_is_child(paths[i], paths[j], pool);
1919
if (strcmp(paths[j], "foodbar") == 0)
1920
SVN_ERR_MALFUNCTION();
1922
if (((remainder) && (! remainders[i][j]))
1923
|| ((! remainder) && (remainders[i][j]))
1924
|| (remainder && strcmp(remainder, remainders[i][j])))
1925
return svn_error_createf
1926
(SVN_ERR_TEST_FAILED, NULL,
1927
"svn_relpath_is_child(%s, %s) returned '%s' instead of '%s'",
1929
remainder ? remainder : "(null)",
1930
remainders[i][j] ? remainders[i][j] : "(null)" );
1934
#undef NUM_TEST_PATHS
1935
return SVN_NO_ERROR;
1939
static svn_error_t *
1940
test_uri_is_child(apr_pool_t *pool)
1944
static const char * const paths[] = {
1946
"http://foo/bar%20bell",
1951
"file://foo/bar/baz%20bol",
1320
1954
static const char * const
1321
1955
remainders[COUNT_OF(paths)][COUNT_OF(paths)] = {
1322
{ 0, 0, 0, "baz", 0, "baz/bing/boom", 0, 0, 0, 0, 0,
1324
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1326
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1328
{ 0, 0, 0, 0, 0, "bing/boom", 0, 0, 0, 0, 0,
1330
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1332
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1334
{ 0, 0, 0, 0, 0, 0, 0, "foo", ".foo", 0, "foo2",
1335
"H:/foo/bar", "H:/foo/baz", "H:", "H:foo", "H:foo/baz" },
1336
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1338
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1340
{ "foo/bar", "foo/bars", "foo/baz", "foo/bar/baz", "flu/blar/blaz",
1341
"foo/bar/baz/bing/boom", 0, 0, 0, 0, 0,
1343
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1346
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1348
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1351
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1352
"foo/bar", "foo/baz", 0, 0, 0 },
1353
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1354
0, 0, 0, 0, "baz" },
1355
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1956
{ 0, 0, 0, 0, 0, 0, 0 },
1957
{ 0, 0, 0, 0, 0, 0, 0 },
1958
{ 0, 0, 0, 0, 0, 0, 0 },
1959
{ "bar", "bar bell", "baz", 0, 0, 0, 0 },
1960
{ 0, 0, 0, 0, 0, 0, 0 },
1961
{ 0, 0, 0, 0, 0, 0, "baz bol" },
1962
{ 0, 0, 0, 0, 0, 0, 0 },
1359
*msg = "test svn_uri_is_child";
1362
return SVN_NO_ERROR;
1364
1965
for (i = 0; i < COUNT_OF(paths); i++)
1366
1967
for (j = 0; j < COUNT_OF(paths); j++)
1368
1969
const char *remainder;
1370
remainder = svn_uri_is_child(paths[i], paths[j], pool);
1971
remainder = svn_uri__is_child(paths[i], paths[j], pool);
1372
1973
if (((remainder) && (! remainders[i][j]))
1373
1974
|| ((! remainder) && (remainders[i][j]))
1374
1975
|| (remainder && strcmp(remainder, remainders[i][j])))
1375
1976
return svn_error_createf
1376
1977
(SVN_ERR_TEST_FAILED, NULL,
1377
"svn_uri_is_child (%s, %s) returned '%s' instead of '%s'",
1978
"svn_uri_is_child (%s, %s) [%d,%d] "
1979
"returned '%s' instead of '%s'",
1980
paths[i], paths[j], i, j,
1379
1981
remainder ? remainder : "(null)",
1380
1982
remainders[i][j] ? remainders[i][j] : "(null)" );
1384
#undef NUM_TEST_PATHS
1385
1986
return SVN_NO_ERROR;
1388
1989
static svn_error_t *
1389
test_dirent_get_absolute(const char **msg,
1390
svn_boolean_t msg_only,
1391
svn_test_opts_t *opts,
1990
test_dirent_get_absolute(apr_pool_t *pool)
1395
1993
const char *curdir;
1396
1994
char buf[8192];
1397
#if defined(WIN32) || defined(__CYGWIN__)
1995
#ifdef SVN_USE_DOS_PATHS
1398
1996
const char *curdironc;
1399
1997
char curdrive[3] = "C:";
1998
#endif /* SVN_USE_DOS_PATHS */
1403
2001
const char *path;
1476
2073
return SVN_NO_ERROR;
1479
static svn_error_t *
1480
test_dirent_local_style(const char **msg,
1481
svn_boolean_t msg_only,
1482
svn_test_opts_t *opts,
2077
static svn_error_t *
2078
test_dirent_get_absolute_from_lc_drive(apr_pool_t *pool)
2080
char current_dir[1024];
2081
char current_dir_on_C[1024];
2084
apr_hash_t *dirents;
2085
apr_hash_index_t *hi;
2086
const char *some_dir_on_C = NULL;
2088
if (! getcwd(current_dir, sizeof(current_dir)))
2089
return svn_error_create(SVN_ERR_BASE, NULL, "getcwd() failed");
2091
/* 3 stands for drive C: */
2092
if (! getdcwd(3, current_dir_on_C, sizeof(current_dir_on_C)))
2093
return svn_error_create(SVN_ERR_BASE, NULL, "getdcwd() failed");
2095
SVN_ERR(svn_io_get_dirents3(&dirents, "C:\\", TRUE, pool, pool));
2097
/* We need a directory on 'C:\' to switch to lower case and back.
2098
We use the first directory we can find that is not the CWD and
2099
where we can chdir to */
2101
for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
2103
const char *dir = svn__apr_hash_index_key(hi);
2104
svn_io_dirent2_t *de = svn__apr_hash_index_val(hi);
2106
if (de->kind == svn_node_dir &&
2107
strcmp(dir, current_dir_on_C))
2109
dir = svn_dirent_join("C:/", dir, pool);
2112
chdir(current_dir_on_C); /* Switch back to old CWD */
2113
some_dir_on_C = dir;
2120
return svn_error_create(SVN_ERR_BASE, NULL,
2121
"No usable test directory found in C:\\");
2123
/* Use the test path, but now with a lower case driveletter */
2124
dir_on_c = apr_pstrdup(pool, some_dir_on_C);
2125
dir_on_c[0] = (char)tolower(dir_on_c[0]);
2129
err = test_dirent_get_absolute(pool);
2131
/* Change back to original directory for next tests */
2132
chdir("C:\\"); /* Switch to upper case */
2133
chdir(current_dir_on_C); /* Switch cwd on C: */
2134
chdir(current_dir); /* Switch back to original cwd */
2139
static svn_error_t *
2140
test_dirent_condense_targets(apr_pool_t *pool)
2144
const char *paths[8];
2146
const char *results[8]; /* must be same size as paths */
2148
{ { "/dir", "/dir/file", NULL }, NULL, { "", "file" } },
2149
{ { "/dir1", "/dir2", NULL }, NULL, { "dir1", "dir2" } },
2150
{ { "dir1", "dir2", NULL }, NULL, { "dir1", "dir2" } },
2151
#ifdef SVN_USE_DOS_PATHS
2152
{ {"C:/", "C:/zeta", NULL}, "C:/", {"", "zeta"} },
2153
{ {"C:/dir", "C:/dir/zeta", NULL}, "C:/dir", {"", "zeta"} },
2154
{ {"C:/dir/omega", "C:/dir/zeta", NULL}, "C:/dir", {"omega", "zeta" } },
2155
{ {"C:/dir", "D:/dir", NULL}, "", {"C:/dir", "D:/dir"} },
2156
{ {"C:A", "C:dir/b", NULL}, NULL, {"A", "dir/b"} },
2158
{ { "/dir", "/dir/file", NULL }, "/dir", { "", "file" } },
2159
{ { "/dir1", "/dir2", NULL }, "/", { "dir1", "dir2" } },
2163
for (i = 0; i < COUNT_OF(tests); i++)
2167
apr_array_header_t *hdr = apr_array_make(pool, 8, sizeof(const char*));
2168
apr_array_header_t *condensed;
2170
for (j = 0; j < COUNT_OF(tests[i].paths); j++)
2172
if (tests[i].paths[j] != NULL)
2173
APR_ARRAY_PUSH(hdr, const char*) = tests[i].paths[j];
2178
SVN_ERR(svn_dirent_condense_targets(&common, &condensed, hdr,
2179
FALSE, pool, pool));
2181
if (tests[i].common != NULL && strcmp(common, tests[i].common))
2182
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2183
"svn_dirent_condense_targets returned common "
2184
"\"%s\". expected \"%s\"",
2185
common, tests[i].common);
2187
for (j = 0; j < COUNT_OF(tests[i].paths); j++)
2189
if (tests[i].paths[j] == NULL || tests[i].results[j] == NULL)
2192
if (strcmp(APR_ARRAY_IDX(condensed, j, const char*),
2193
tests[i].results[j]))
2194
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2195
"svn_dirent_condense_targets returned first"
2196
"\"%s\". expected \"%s\"",
2197
APR_ARRAY_IDX(condensed, j, const char*),
2198
tests[i].results[j]);
2203
return SVN_NO_ERROR;
2206
static svn_error_t *
2207
test_uri_condense_targets(apr_pool_t *pool)
2211
const char *paths[8];
2213
const char *results[8]; /* must be same size as paths */
2215
/* { { url1, url2, url3 },
2217
{ relpath1, relpath2, relpath3 } }
2219
{ { "sc://s/A", "sc://s/B", "sc://s" },
2222
{ { "sc://S/A", "sc://S/B", "sc://S" },
2225
{ { "sc://A/A", "sc://B/B", "sc://s" },
2227
{ "sc://a/A", "sc://b/B", "sc://s" } },
2228
{ { "sc://A/A", "sc://A/a/B", "sc://a/Q" },
2230
{ "A", "a/B", "Q"} },
2231
{ { "sc://server/foo%20bar", "sc://server/baz", "sc://server/blarg" },
2233
{ "foo bar", "baz", "blarg"} },
2236
for (i = 0; i < COUNT_OF(tests); i++)
2240
apr_array_header_t *hdr = apr_array_make(pool, 8, sizeof(const char*));
2241
apr_array_header_t *condensed;
2243
for (j = 0; j < COUNT_OF(tests[i].paths); j++)
2245
if (tests[i].paths[j] != NULL)
2246
APR_ARRAY_PUSH(hdr, const char*) = tests[i].paths[j];
2251
SVN_ERR(svn_uri_condense_targets(&common, &condensed, hdr,
2252
FALSE, pool, pool));
2254
if (tests[i].common != NULL && strcmp(common, tests[i].common))
2255
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2256
"svn_uri_condense_targets returned common "
2257
"\"%s\". expected \"%s\"",
2258
common, tests[i].common);
2260
for (j = 0; j < COUNT_OF(tests[i].paths); j++)
2262
if (tests[i].paths[j] == NULL || tests[i].results[j] == NULL)
2265
if (strcmp(APR_ARRAY_IDX(condensed, j, const char*),
2266
tests[i].results[j]))
2267
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2268
"svn_uri_condense_targets returned first"
2269
"\"%s\". expected \"%s\"",
2270
APR_ARRAY_IDX(condensed, j, const char*),
2271
tests[i].results[j]);
2276
return SVN_NO_ERROR;
2279
static svn_error_t *
2280
test_dirent_local_style(apr_pool_t *pool)
1486
2283
const char *path;
1671
2400
return SVN_NO_ERROR;
2403
static svn_error_t *
2404
test_dirent_from_file_url(apr_pool_t *pool)
2411
{ "file:///dir", "/dir" },
2412
{ "file:///dir/path", "/dir/path" },
2413
{ "file://localhost", "/" },
2414
{ "file://localhost/dir", "/dir" },
2415
{ "file://localhost/dir/path", "/dir/path" },
2416
#ifdef SVN_USE_DOS_PATHS
2417
{ "file://server/share", "//server/share" },
2418
{ "file://server/share/dir", "//server/share/dir" },
2419
{ "file:///A:", "A:/" },
2420
{ "file:///A:/dir", "A:/dir" },
2421
{ "file:///A:dir", "A:dir" },
2422
{ "file:///A%7C", "A:/" },
2423
{ "file:///A%7C/dir", "A:/dir" },
2424
{ "file:///A%7Cdir", "A:dir" },
2429
for (i = 0; i < COUNT_OF(tests); i++)
2433
SVN_ERR(svn_uri_get_dirent_from_file_url(&result, tests[i].url, pool));
2435
if (strcmp(result, tests[i].result))
2436
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2437
"svn_uri_get_dirent_from_file_url(\"%s\") "
2438
"returned \"%s\" expected \"%s\"",
2439
tests[i].url, result, tests[i].result);
2442
return SVN_NO_ERROR;
2445
static svn_error_t *
2446
test_dirent_from_file_url_errors(apr_pool_t *pool)
2448
const char *bad_file_urls[] = {
2449
/* error if scheme is not "file" */
2450
"http://localhost/dir",
2451
"file+ssh://localhost/dir",
2452
#ifndef SVN_USE_DOS_PATHS
2453
"file://localhostwrongname/dir", /* error if host name not "localhost" */
2458
for (i = 0; i < COUNT_OF(bad_file_urls); i++)
2463
err = svn_uri_get_dirent_from_file_url(&result, bad_file_urls[i],
2467
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2468
"svn_uri_get_dirent_from_file_url(\"%s\") "
2469
"didn't return an error.",
2471
svn_error_clear(err);
2474
return SVN_NO_ERROR;
2477
static svn_error_t *
2478
test_file_url_from_dirent(apr_pool_t *pool)
2484
#ifdef SVN_USE_DOS_PATHS
2485
{ "C:/file", "file:///C:/file" },
2486
{ "C:/", "file:///C:/" },
2487
{ "C:/File#$", "file:///C:/File%23$" },
2488
/* We can't check these as svn_dirent_get_absolute() won't work
2489
on shares that don't exist */
2490
/*{ "//server/share", "file://server/share" },
2491
{ "//server/share/file", "file://server/share/file" },*/
2493
{ "/a/b", "file:///a/b" },
2494
{ "/a", "file:///a" },
2496
{ "/File#$", "file:///File%23$" },
2501
for (i = 0; i < COUNT_OF(tests); i++)
2505
SVN_ERR(svn_uri_get_file_url_from_dirent(&result, tests[i].dirent,
2508
if (strcmp(result, tests[i].result))
2509
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2510
"svn_uri_get_file_url_from_dirent(\"%s\") "
2511
"returned \"%s\" expected \"%s\"",
2512
tests[i].dirent, result, tests[i].result);
2515
return SVN_NO_ERROR;
2518
static svn_error_t *
2519
test_dirent_is_under_root(apr_pool_t *pool)
2522
const char *base_path;
2524
svn_boolean_t under_root;
2527
{ "", "", TRUE, ""},
2528
{ "", "r", TRUE, "r"},
2529
{ "", "r/..", TRUE, ""},
2530
{ "", "r/../..", FALSE},
2531
{ "", "r/../../b", FALSE},
2533
{ "", "../r", FALSE},
2536
{ "", "/..", FALSE},
2537
{ "b", "", TRUE, "b"},
2538
{ "b", "r", TRUE, "b/r"},
2539
{ "b", "r/..", TRUE, "b"},
2540
{ "b", "r/../..", FALSE},
2541
{ "b", "r/../../b", FALSE},
2542
{ "b", "..", FALSE},
2543
{ "b", "../r", FALSE},
2544
{ "b", "../b", FALSE},
2546
{ "b", "/r", FALSE},
2547
{ "b", "/..", FALSE},
2548
{ "/", "", TRUE, "/"},
2549
{ "/", "r", TRUE, "/r"},
2550
{ "/", "r/..", TRUE, "/"},
2551
{ "/", "r/../..", FALSE},
2552
{ "/", "r/../../b", FALSE},
2553
{ "/", "..", FALSE},
2554
{ "/", "../r", FALSE},
2556
{ "/", "/r", FALSE},
2557
{ "/", "/..", FALSE},
2558
{ "/b", "", TRUE, "/b"},
2559
{ "/b", "r", TRUE, "/b/r"},
2560
{ "/b", "r/..", TRUE, "/b"},
2561
{ "/b", "r/../..", FALSE},
2562
{ "/b", "r/../../b", FALSE},
2563
{ "/b", "..", FALSE},
2564
{ "/b", "../r", FALSE},
2565
{ "/b", "../b", FALSE},
2566
{ "/b", "/", FALSE},
2567
{ "/b", "/r", FALSE},
2568
{ "/b", "/..", FALSE},
2569
{ "/", "/base", FALSE},
2570
{ "/aa", "/aa/bb", FALSE},
2571
{ "/base", "/base2", FALSE},
2572
{ "/b", "bb", TRUE, "/b/bb"},
2573
{ "/b", "../bb", FALSE},
2574
{ "/b", "r/./bb", TRUE, "/b/r/bb"},
2575
{ "/b", "r/../bb", TRUE, "/b/bb"},
2576
{ "/b", "r/../../bb", FALSE},
2577
{ "/b", "./bb", TRUE, "/b/bb"},
2578
{ "/b", ".", TRUE, "/b"},
2579
{ "/b", "", TRUE, "/b"},
2580
{ "b", "b", TRUE, "b/b"},
2581
#ifdef SVN_USE_DOS_PATHS
2582
{ "C:/file", "a\\d", TRUE, "C:/file/a/d"},
2583
{ "C:/file", "aa\\..\\d", TRUE, "C:/file/d"},
2584
{ "C:/file", "aa\\..\\..\\d", FALSE},
2586
{ "C:/file", "a\\d", TRUE, "C:/file/a\\d"},
2587
{ "C:/file", "aa\\..\\d", TRUE, "C:/file/aa\\..\\d"},
2588
{ "C:/file", "aa\\..\\..\\d", TRUE, "C:/file/aa\\..\\..\\d"},
2589
#endif /* SVN_USE_DOS_PATHS */
2593
for (i = 0; i < COUNT_OF(tests); i++)
2595
svn_boolean_t under_root;
2598
SVN_ERR(svn_dirent_is_under_root(&under_root,
2604
if (under_root != tests[i].under_root)
2605
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2606
"svn_dirent_is_under_root(..\"%s\", \"%s\"..)"
2607
" returned %s expected %s.",
2610
under_root ? "TRUE" : "FALSE",
2611
tests[i].under_root ? "TRUE" : "FALSE");
2614
&& strcmp(result, tests[i].result) != 0)
2615
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2616
"svn_dirent_is_under_root(..\"%s\", \"%s\"..)"
2617
" found \"%s\" expected \"%s\".",
2624
return SVN_NO_ERROR;
2627
static svn_error_t *
2628
test_fspath_is_canonical(apr_pool_t *pool)
2630
const testcase_is_canonical_t *t;
2631
static const testcase_is_canonical_t tests[] = {
2642
{ "/\\a", TRUE }, /* a single component */
2643
{ "/a\\", TRUE }, /* a single component */
2644
{ "/a\\b", TRUE }, /* a single component */
2647
for (t = tests; t < tests + COUNT_OF(tests); t++)
2649
svn_boolean_t canonical
2650
= svn_fspath__is_canonical(t->path);
2652
if (t->canonical != canonical)
2653
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
2654
"svn_fspath__is_canonical(\"%s\") returned "
2655
"\"%s\" expected \"%s\"",
2657
canonical ? "TRUE" : "FALSE",
2658
t->canonical ? "TRUE" : "FALSE");
2661
return SVN_NO_ERROR;
2664
static svn_error_t *
2665
test_fspath_join(apr_pool_t *pool)
2669
static const char * const joins[][3] = {
2672
{ "/", "d/e", "/d/e" },
2673
{ "/abc", "", "/abc" },
2674
{ "/abc", "d", "/abc/d" },
2675
{ "/abc", "d/e", "/abc/d/e" },
2678
for (i = 0; i < COUNT_OF(joins); i++ )
2680
char *result = svn_fspath__join(joins[i][0], joins[i][1], pool);
2682
SVN_TEST_STRING_ASSERT(result, joins[i][2]);
2685
return SVN_NO_ERROR;
2688
static svn_error_t *
2689
test_fspath_is_child(apr_pool_t *pool)
2693
static const char * const paths[] = {
2702
static const char * const
2703
remainders[COUNT_OF(paths)][COUNT_OF(paths)] = {
2704
{ 0, "f", "foo", "foo/bar", "foo/bars", "foo/bar/baz" },
2705
{ 0, 0, 0, 0, 0, 0 },
2706
{ 0, 0, 0, "bar", "bars", "bar/baz" },
2707
{ 0, 0, 0, 0, 0, "baz" },
2708
{ 0, 0, 0, 0, 0, 0 },
2709
{ 0, 0, 0, 0, 0, 0 },
2712
for (i = 0; i < COUNT_OF(paths); i++)
2714
for (j = 0; j < COUNT_OF(paths); j++)
2716
const char *remainder
2717
= svn_fspath__is_child(paths[i], paths[j], pool);
2719
SVN_TEST_STRING_ASSERT(remainder, remainders[i][j]);
2723
return SVN_NO_ERROR;
2726
static svn_error_t *
2727
test_fspath_dirname_basename_split(apr_pool_t *pool)
2731
static const struct {
2733
const char *dirname;
2734
const char *basename;
2738
{ "/abc", "/", "abc" },
2739
{ "/x/abc", "/x", "abc" },
2740
{ "/x/y/abc", "/x/y", "abc" },
2743
for (i = 0; i < COUNT_OF(tests); i++)
2745
const char *result_dirname, *result_basename;
2747
result_dirname = svn_fspath__dirname(tests[i].path, pool);
2748
SVN_TEST_STRING_ASSERT(result_dirname, tests[i].dirname);
2750
result_basename = svn_fspath__basename(tests[i].path, pool);
2751
SVN_TEST_STRING_ASSERT(result_basename, tests[i].basename);
2753
svn_fspath__split(&result_dirname, &result_basename, tests[i].path,
2755
SVN_TEST_STRING_ASSERT(result_dirname, tests[i].dirname);
2756
SVN_TEST_STRING_ASSERT(result_basename, tests[i].basename);
2759
return SVN_NO_ERROR;
2762
static svn_error_t *
2763
test_fspath_get_longest_ancestor(apr_pool_t *pool)
2765
const testcase_get_longest_ancestor_t *t;
2767
/* Paths to test and their expected results. Same as in
2768
* test_relpath_get_longest_ancestor() but with '/' prefix. */
2769
static const testcase_get_longest_ancestor_t tests[] = {
2770
{ "/foo", "/foo/bar", "/foo" },
2771
{ "/foo/bar", "/foo/bar", "/foo/bar" },
2772
{ "/", "/foo", "/" },
2773
{ "/", "/foo", "/" },
2774
{ "/", "/.bar", "/" },
2775
{ "/.bar", "/", "/" },
2776
{ "/foo/bar", "/foo", "/foo" },
2777
{ "/foo/bar", "/foo", "/foo" },
2778
{ "/rif", "/raf", "/" },
2779
{ "/foo", "/bar", "/" },
2780
{ "/foo", "/foo/bar", "/foo" },
2781
{ "/foo.", "/foo./.bar", "/foo." },
2783
{ "/http:/test", "/http:/test", "/http:/test" },
2784
{ "/http:/test", "/http:/taste", "/http:" },
2785
{ "/http:/test", "/http:/test/foo", "/http:/test" },
2786
{ "/http:/test", "/file:/test/foo", "/" },
2787
{ "/http:/test", "/http:/testF", "/http:" },
2788
{ "/file:/A/C", "/file:/B/D", "/file:" },
2789
{ "/file:/A/C", "/file:/A/D", "/file:/A" },
2790
{ "/X:/foo", "/X:", "/X:" },
2791
{ "/X:/folder1", "/X:/folder2", "/X:" },
2792
{ "/X:", "/X:foo", "/" },
2793
{ "/X:foo", "/X:bar", "/" },
2796
for (t = tests; t < tests + COUNT_OF(tests); t++)
2800
result = svn_fspath__get_longest_ancestor(t->path1, t->path2, pool);
2801
SVN_TEST_STRING_ASSERT(t->result, result);
2803
/* changing the order of the paths should return the same result */
2804
result = svn_fspath__get_longest_ancestor(t->path2, t->path1, pool);
2805
SVN_TEST_STRING_ASSERT(t->result, result);
2807
return SVN_NO_ERROR;
1675
2811
/* The test table. */
1677
2813
struct svn_test_descriptor_t test_funcs[] =
1680
SVN_TEST_PASS(test_dirent_is_root),
1681
SVN_TEST_PASS(test_uri_is_root),
1682
SVN_TEST_PASS(test_dirent_is_absolute),
1683
SVN_TEST_PASS(test_uri_is_absolute),
1684
SVN_TEST_PASS(test_dirent_join),
1685
SVN_TEST_PASS(test_dirent_dirname),
1686
SVN_TEST_PASS(test_uri_dirname),
1687
SVN_TEST_PASS(test_dirent_canonicalize),
1688
SVN_TEST_PASS(test_uri_canonicalize),
1689
SVN_TEST_PASS(test_dirent_is_canonical),
1690
SVN_TEST_PASS(test_uri_is_canonical),
1691
SVN_TEST_PASS(test_dirent_get_longest_ancestor),
1692
SVN_TEST_PASS(test_uri_get_longest_ancestor),
1693
SVN_TEST_PASS(test_dirent_is_child),
1694
SVN_TEST_PASS(test_uri_is_child),
1695
SVN_TEST_PASS(test_dirent_is_ancestor),
1696
SVN_TEST_PASS(test_uri_is_ancestor),
1697
SVN_TEST_PASS(test_dirent_get_absolute),
1698
SVN_TEST_PASS(test_dirent_local_style),
1699
SVN_TEST_PASS(test_uri_local_style),
1700
SVN_TEST_PASS(test_dirent_internal_style),
1701
SVN_TEST_PASS(test_uri_internal_style),
2816
SVN_TEST_PASS2(test_dirent_is_root,
2817
"test svn_dirent_is_root"),
2818
SVN_TEST_PASS2(test_uri_is_root,
2819
"test svn_uri_is_root"),
2820
SVN_TEST_PASS2(test_dirent_is_absolute,
2821
"test svn_dirent_is_absolute"),
2822
SVN_TEST_PASS2(test_dirent_join,
2823
"test svn_dirent_join(_many)"),
2824
SVN_TEST_PASS2(test_relpath_join,
2825
"test svn_relpath_join"),
2826
SVN_TEST_PASS2(test_dirent_basename,
2827
"test svn_dirent_basename"),
2828
SVN_TEST_PASS2(test_relpath_basename,
2829
"test svn_relpath_basename"),
2830
SVN_TEST_PASS2(test_uri_basename,
2831
"test svn_uri_basename"),
2832
SVN_TEST_PASS2(test_relpath_dirname,
2833
"test svn_relpath_dirname"),
2834
SVN_TEST_PASS2(test_dirent_dirname,
2835
"test svn_dirent_dirname"),
2836
SVN_TEST_PASS2(test_uri_dirname,
2837
"test svn_dirent_dirname"),
2838
SVN_TEST_PASS2(test_dirent_canonicalize,
2839
"test svn_dirent_canonicalize"),
2840
SVN_TEST_PASS2(test_relpath_canonicalize,
2841
"test svn_relpath_canonicalize"),
2842
SVN_TEST_PASS2(test_uri_canonicalize,
2843
"test svn_uri_canonicalize"),
2844
SVN_TEST_PASS2(test_dirent_is_canonical,
2845
"test svn_dirent_is_canonical"),
2846
SVN_TEST_PASS2(test_relpath_is_canonical,
2847
"test svn_relpath_is_canonical"),
2848
SVN_TEST_PASS2(test_uri_is_canonical,
2849
"test svn_uri_is_canonical"),
2850
SVN_TEST_PASS2(test_dirent_split,
2851
"test svn_dirent_split"),
2852
SVN_TEST_PASS2(test_relpath_split,
2853
"test svn_relpath_split"),
2854
SVN_TEST_PASS2(test_uri_split,
2855
"test svn_uri_split"),
2856
SVN_TEST_PASS2(test_dirent_get_longest_ancestor,
2857
"test svn_dirent_get_longest_ancestor"),
2858
SVN_TEST_PASS2(test_relpath_get_longest_ancestor,
2859
"test svn_relpath_get_longest_ancestor"),
2860
SVN_TEST_PASS2(test_uri_get_longest_ancestor,
2861
"test svn_uri_get_longest_ancestor"),
2862
SVN_TEST_PASS2(test_dirent_is_child,
2863
"test svn_dirent_is_child"),
2864
SVN_TEST_PASS2(test_relpath_is_child,
2865
"test svn_relpath_is_child"),
2866
SVN_TEST_PASS2(test_uri_is_child,
2867
"test svn_uri_is_child"),
2868
SVN_TEST_PASS2(test_dirent_is_ancestor,
2869
"test svn_dirent_is_ancestor"),
2870
SVN_TEST_PASS2(test_relpath_is_ancestor,
2871
"test svn_relpath_is_ancestor"),
2872
SVN_TEST_PASS2(test_uri_is_ancestor,
2873
"test svn_uri_is_ancestor"),
2874
SVN_TEST_PASS2(test_dirent_skip_ancestor,
2875
"test svn_dirent_skip_ancestor"),
2876
SVN_TEST_PASS2(test_relpath_skip_ancestor,
2877
"test svn_relpath_skip_ancestor"),
2878
SVN_TEST_PASS2(test_uri_skip_ancestor,
2879
"test svn_uri_skip_ancestor"),
2880
SVN_TEST_PASS2(test_dirent_get_absolute,
2881
"test svn_dirent_get_absolute"),
2883
SVN_TEST_PASS2(test_dirent_get_absolute_from_lc_drive,
2884
"test svn_dirent_get_absolute (needs recent apr)"),
2886
SVN_TEST_PASS2(test_dirent_condense_targets,
2887
"test svn_dirent_condense_targets"),
2888
SVN_TEST_PASS2(test_uri_condense_targets,
2889
"test svn_uri_condense_targets"),
2890
SVN_TEST_PASS2(test_dirent_local_style,
2891
"test svn_dirent_local_style"),
2892
SVN_TEST_PASS2(test_dirent_internal_style,
2893
"test svn_dirent_internal_style"),
2894
SVN_TEST_PASS2(test_relpath_internal_style,
2895
"test svn_relpath_internal_style"),
2896
SVN_TEST_PASS2(test_dirent_from_file_url,
2897
"test svn_uri_get_dirent_from_file_url"),
2898
SVN_TEST_PASS2(test_dirent_from_file_url_errors,
2899
"test svn_uri_get_dirent_from_file_url errors"),
2900
SVN_TEST_PASS2(test_file_url_from_dirent,
2901
"test svn_uri_get_file_url_from_dirent"),
2902
SVN_TEST_PASS2(test_dirent_is_under_root,
2903
"test svn_dirent_is_under_root"),
2904
SVN_TEST_PASS2(test_fspath_is_canonical,
2905
"test svn_fspath__is_canonical"),
2906
SVN_TEST_PASS2(test_fspath_join,
2907
"test svn_fspath__join"),
2908
SVN_TEST_PASS2(test_fspath_is_child,
2909
"test svn_fspath__is_child"),
2910
SVN_TEST_PASS2(test_fspath_dirname_basename_split,
2911
"test svn_fspath__dirname/basename/split"),
2912
SVN_TEST_PASS2(test_fspath_get_longest_ancestor,
2913
"test svn_fspath__get_longest_ancestor"),