Differences From Artifact [bf4e4ccf3c]:
- File tests/OFSet.m — part of check-in [813c00ccf0] at 2013-01-09 22:24:47 on branch trunk — Update copyright. (user: js, size: 3523) [annotate] [blame] [check-ins using]
To Artifact [6ea1882c4f]:
- File
tests/OFSet.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 3543) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
29 30 31 32 33 34 35 | @implementation TestsAppDelegate (OFSetTests) - (void)setTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFSet *set1, *set2; OFMutableSet *mutableSet; #ifdef OF_HAVE_FAST_ENUMERATION | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | @implementation TestsAppDelegate (OFSetTests) - (void)setTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFSet *set1, *set2; OFMutableSet *mutableSet; #ifdef OF_HAVE_FAST_ENUMERATION bool ok; size_t i; #endif TEST(@"+[setWithArray:]", (set1 = [OFSet setWithArray: [OFArray arrayWithObjects: @"foo", @"bar", @"baz", @"foo", @"x", nil]])) |
︙ | ︙ | |||
88 89 90 91 92 93 94 | TEST(@"-[unionSet:]", R([mutableSet unionSet: ([OFSet setWithObjects: @"x", @"bar", nil])]) && [mutableSet isEqual: ([OFSet setWithObjects: @"baz", @"bar", @"x", nil])]) #ifdef OF_HAVE_FAST_ENUMERATION | | | | | | | | | | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | TEST(@"-[unionSet:]", R([mutableSet unionSet: ([OFSet setWithObjects: @"x", @"bar", nil])]) && [mutableSet isEqual: ([OFSet setWithObjects: @"baz", @"bar", @"x", nil])]) #ifdef OF_HAVE_FAST_ENUMERATION ok = true; i = 0; for (OFString *s in set1) { switch (i) { case 0: if (![s isEqual: @"x"]) ok = false; break; case 1: if (![s isEqual: @"bar"]) ok = false; break; case 2: if (![s isEqual: @"foo"]) ok = false; break; case 3: if (![s isEqual: @"baz"]) ok = false; break; } i++; } if (i != 4) ok = false; TEST(@"Fast enumeration", ok) ok = false; @try { for (OFString *s in mutableSet) [mutableSet removeObject: s]; } @catch (OFEnumerationMutationException *e) { ok = true; } TEST(@"Detection of mutation during Fast Enumeration", ok); #endif [pool drain]; } @end |