ObjFW  Check-in [e649da7412]

Overview
Comment:tests: Use the same path tests on Wii as on 3DS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e649da74120e20649a3deb6f684e9bd1274a10035c8f156986974639ab8d3378
User & Date: js on 2018-08-25 19:09:16
Other Links: manifest | tags
Context
2018-08-26
12:46
Initial support for async connect without threads check-in: 1e79c0a969 user: js tags: trunk
2018-08-25
19:09
tests: Use the same path tests on Wii as on 3DS check-in: e649da7412 user: js tags: trunk
19:04
Do not use lstat() on Wii check-in: 66238960cb user: js tags: trunk
Changes

Modified tests/OFStringTests.m from [b8eafda052] to [ab9d38a9ea].

556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
	TEST(@"-[isAbsolutePath]",
	    [C(@"C:\\foo") isAbsolutePath] && [C(@"a:/foo") isAbsolutePath] &&
	    ![C(@"foo") isAbsolutePath] && ![C(@"b:foo") isAbsolutePath])
# elif defined(OF_AMIGAOS)
	TEST(@"-[isAbsolutePath]",
	    [C(@"dh0:foo") isAbsolutePath] && [C(@"dh0:a/b") isAbsolutePath] &&
	    ![C(@"foo/bar") isAbsolutePath] && ![C(@"foo") isAbsolutePath])
# elif defined(OF_NINTENDO_3DS)
	TEST(@"-[isAbsolutePath]",
	    [C(@"sdmc:/foo") isAbsolutePath] &&
	    ![C(@"sdmc:foo") isAbsolutePath] &&
	    ![C(@"foo/bar") isAbsolutePath] && ![C(@"foo") isAbsolutePath])
# else
	TEST(@"-[isAbsolutePath]",
	    [C(@"/foo") isAbsolutePath] && [C(@"/foo/bar") isAbsolutePath] &&







|







556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
	TEST(@"-[isAbsolutePath]",
	    [C(@"C:\\foo") isAbsolutePath] && [C(@"a:/foo") isAbsolutePath] &&
	    ![C(@"foo") isAbsolutePath] && ![C(@"b:foo") isAbsolutePath])
# elif defined(OF_AMIGAOS)
	TEST(@"-[isAbsolutePath]",
	    [C(@"dh0:foo") isAbsolutePath] && [C(@"dh0:a/b") isAbsolutePath] &&
	    ![C(@"foo/bar") isAbsolutePath] && ![C(@"foo") isAbsolutePath])
# elif defined(OF_NINTENDO_3DS) || defined(OF_WII)
	TEST(@"-[isAbsolutePath]",
	    [C(@"sdmc:/foo") isAbsolutePath] &&
	    ![C(@"sdmc:foo") isAbsolutePath] &&
	    ![C(@"foo/bar") isAbsolutePath] && ![C(@"foo") isAbsolutePath])
# else
	TEST(@"-[isAbsolutePath]",
	    [C(@"/foo") isAbsolutePath] && [C(@"/foo/bar") isAbsolutePath] &&
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", @"bar", @"baz", nil]] isEqual: @"foo/bar/baz"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo/", @"bar", @"", @"baz", @"/", nil]]
	    isEqual: @"foo//bar/baz//"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", nil]] isEqual: @"foo"])
# elif defined(OF_NINTENDO_3DS)
	TEST(@"+[pathWithComponents:]",
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", @"bar", @"baz", nil]] isEqual: @"foo/bar/baz"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"sdmc:", @"foo", @"bar", @"baz", nil]]
	    isEqual: @"sdmc:/foo/bar/baz"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:







|







682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", @"bar", @"baz", nil]] isEqual: @"foo/bar/baz"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo/", @"bar", @"", @"baz", @"/", nil]]
	    isEqual: @"foo//bar/baz//"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", nil]] isEqual: @"foo"])
# elif defined(OF_NINTENDO_3DS) || defined(OF_WII)
	TEST(@"+[pathWithComponents:]",
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", @"bar", @"baz", nil]] isEqual: @"foo/bar/baz"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
	    @"sdmc:", @"foo", @"bar", @"baz", nil]]
	    isEqual: @"sdmc:/foo/bar/baz"] &&
	    [[stringClass pathWithComponents: [OFArray arrayWithObjects:
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
	    [[a objectAtIndex: 1] isEqual: @"bar"] &&
	    [[a objectAtIndex: 2] isEqual: @"baz"] &&
	    /* foo// */
	    (a = [C(@"foo//") pathComponents]) && [a count] == 2 &&
	    [[a objectAtIndex: 0] isEqual: @"foo"] &&
	    [[a objectAtIndex: 1] isEqual: @"/"] &&
	    [[C(@"") pathComponents] count] == 0)
# elif defined(OF_NINTENDO_3DS)
	TEST(@"-[pathComponents]",
	    /* sdmc:/tmp */
	    (a = [C(@"sdmc:/tmp") pathComponents]) && [a count] == 2 &&
	    [[a objectAtIndex: 0] isEqual: @"sdmc:"] &&
	    [[a objectAtIndex: 1] isEqual: @"tmp"] &&
	    /* sdmc:/ */
	    (a = [C(@"sdmc:/") pathComponents]) && [a count] == 1 &&







|







763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
	    [[a objectAtIndex: 1] isEqual: @"bar"] &&
	    [[a objectAtIndex: 2] isEqual: @"baz"] &&
	    /* foo// */
	    (a = [C(@"foo//") pathComponents]) && [a count] == 2 &&
	    [[a objectAtIndex: 0] isEqual: @"foo"] &&
	    [[a objectAtIndex: 1] isEqual: @"/"] &&
	    [[C(@"") pathComponents] count] == 0)
# elif defined(OF_NINTENDO_3DS) || defined(OF_WII)
	TEST(@"-[pathComponents]",
	    /* sdmc:/tmp */
	    (a = [C(@"sdmc:/tmp") pathComponents]) && [a count] == 2 &&
	    [[a objectAtIndex: 0] isEqual: @"sdmc:"] &&
	    [[a objectAtIndex: 1] isEqual: @"tmp"] &&
	    /* sdmc:/ */
	    (a = [C(@"sdmc:/") pathComponents]) && [a count] == 1 &&
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
	    [[C(@"dh0:tmp") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"dh0:tmp/") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"dh0:/") lastPathComponent] isEqual: @"/"] &&
	    [[C(@"dh0:") lastPathComponent] isEqual: @"dh0:"] &&
	    [[C(@"foo") lastPathComponent] isEqual: @"foo"] &&
	    [[C(@"foo/bar") lastPathComponent] isEqual: @"bar"] &&
	    [[C(@"foo/bar/baz/") lastPathComponent] isEqual: @"baz"])
# elif defined(OF_NINTENDO_3DS)
	TEST(@"-[lastPathComponent]",
	    [[C(@"sdmc:/tmp") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"sdmc:/tmp/") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"sdmc:/") lastPathComponent] isEqual: @"sdmc:/"] &&
	    [[C(@"sdmc:") lastPathComponent] isEqual: @"sdmc:"] &&
	    [[C(@"foo") lastPathComponent] isEqual: @"foo"] &&
	    [[C(@"foo/bar") lastPathComponent] isEqual: @"bar"] &&







|







832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
	    [[C(@"dh0:tmp") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"dh0:tmp/") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"dh0:/") lastPathComponent] isEqual: @"/"] &&
	    [[C(@"dh0:") lastPathComponent] isEqual: @"dh0:"] &&
	    [[C(@"foo") lastPathComponent] isEqual: @"foo"] &&
	    [[C(@"foo/bar") lastPathComponent] isEqual: @"bar"] &&
	    [[C(@"foo/bar/baz/") lastPathComponent] isEqual: @"baz"])
# elif defined(OF_NINTENDO_3DS) || defined(OF_WII)
	TEST(@"-[lastPathComponent]",
	    [[C(@"sdmc:/tmp") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"sdmc:/tmp/") lastPathComponent] isEqual: @"tmp"] &&
	    [[C(@"sdmc:/") lastPathComponent] isEqual: @"sdmc:/"] &&
	    [[C(@"sdmc:") lastPathComponent] isEqual: @"sdmc:"] &&
	    [[C(@"foo") lastPathComponent] isEqual: @"foo"] &&
	    [[C(@"foo/bar") lastPathComponent] isEqual: @"bar"] &&
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
	    [[C(@"dh0:/") stringByDeletingLastPathComponent]
	    isEqual: @"dh0:"] &&
	    [[C(@"dh0:tmp/foo/") stringByDeletingLastPathComponent]
	    isEqual: @"dh0:tmp"] &&
	    [[C(@"foo/bar") stringByDeletingLastPathComponent]
	    isEqual: @"foo"] &&
	    [[C(@"foo") stringByDeletingLastPathComponent] isEqual: @""])
# elif defined(OF_NINTENDO_3DS)
	TEST(@"-[stringByDeletingLastPathComponent]",
	    [[C(@"/tmp/") stringByDeletingLastPathComponent] isEqual: @""] &&
	    [[C(@"sdmc:/tmp/foo/") stringByDeletingLastPathComponent]
	    isEqual: @"sdmc:/tmp"] &&
	    [[C(@"sdmc:/") stringByDeletingLastPathComponent]
	    isEqual: @"sdmc:/"] &&
	    [[C(@"foo/bar") stringByDeletingLastPathComponent]







|







883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
	    [[C(@"dh0:/") stringByDeletingLastPathComponent]
	    isEqual: @"dh0:"] &&
	    [[C(@"dh0:tmp/foo/") stringByDeletingLastPathComponent]
	    isEqual: @"dh0:tmp"] &&
	    [[C(@"foo/bar") stringByDeletingLastPathComponent]
	    isEqual: @"foo"] &&
	    [[C(@"foo") stringByDeletingLastPathComponent] isEqual: @""])
# elif defined(OF_NINTENDO_3DS) || defined(OF_WII)
	TEST(@"-[stringByDeletingLastPathComponent]",
	    [[C(@"/tmp/") stringByDeletingLastPathComponent] isEqual: @""] &&
	    [[C(@"sdmc:/tmp/foo/") stringByDeletingLastPathComponent]
	    isEqual: @"sdmc:/tmp"] &&
	    [[C(@"sdmc:/") stringByDeletingLastPathComponent]
	    isEqual: @"sdmc:/"] &&
	    [[C(@"foo/bar") stringByDeletingLastPathComponent]
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
	    [[C(@"dh0:foo./bar.baz") stringByDeletingPathExtension]
	    isEqual: @"dh0:foo./bar"] &&
	    [[C(@"foo.bar/") stringByDeletingPathExtension] isEqual: @"foo"] &&
	    [[C(@".foo") stringByDeletingPathExtension] isEqual: @".foo"] &&
	    [[C(@".foo\\bar") stringByDeletingPathExtension]
	    isEqual: @".foo\\bar"] &&
	    [[C(@".foo.bar") stringByDeletingPathExtension] isEqual: @".foo"])
# elif defined(OF_NINTENDO_3DS)
	TEST(@"-[stringByDeletingPathExtension]",
	    [[C(@"foo.bar") stringByDeletingPathExtension] isEqual: @"foo"] &&
	    [[C(@"foo..bar") stringByDeletingPathExtension] isEqual: @"foo."] &&
	    [[C(@"sdmc:/foo./bar") stringByDeletingPathExtension]
	    isEqual: @"sdmc:/foo./bar"] &&
	    [[C(@"sdmc:/foo./bar.baz") stringByDeletingPathExtension]
	    isEqual: @"sdmc:/foo./bar"] &&







|







932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
	    [[C(@"dh0:foo./bar.baz") stringByDeletingPathExtension]
	    isEqual: @"dh0:foo./bar"] &&
	    [[C(@"foo.bar/") stringByDeletingPathExtension] isEqual: @"foo"] &&
	    [[C(@".foo") stringByDeletingPathExtension] isEqual: @".foo"] &&
	    [[C(@".foo\\bar") stringByDeletingPathExtension]
	    isEqual: @".foo\\bar"] &&
	    [[C(@".foo.bar") stringByDeletingPathExtension] isEqual: @".foo"])
# elif defined(OF_NINTENDO_3DS) || defined(OF_WII)
	TEST(@"-[stringByDeletingPathExtension]",
	    [[C(@"foo.bar") stringByDeletingPathExtension] isEqual: @"foo"] &&
	    [[C(@"foo..bar") stringByDeletingPathExtension] isEqual: @"foo."] &&
	    [[C(@"sdmc:/foo./bar") stringByDeletingPathExtension]
	    isEqual: @"sdmc:/foo./bar"] &&
	    [[C(@"sdmc:/foo./bar.baz") stringByDeletingPathExtension]
	    isEqual: @"sdmc:/foo./bar"] &&