Differences From Artifact [ede47645fa]:
- File tests/OFListTests.m — part of check-in [8573ef86c6] at 2021-04-25 16:48:25 on branch trunk — Make OFListItem opaque (user: js, size: 3930) [annotate] [blame] [check-ins using] [more...]
To Artifact [8b9464c149]:
- File
tests/OFListTests.m
— part of check-in
[14f1e22d79]
at
2021-05-08 23:22:59
on branch trunk
— tests: Align more with ObjFW style
ObjFW's style changed over the years, but the tests were never adjusted
to it. (user: js, size: 3943) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
27 28 29 30 31 32 33 | @implementation TestsAppDelegate (OFListTests) - (void)listTests { void *pool = objc_autoreleasePoolPush(); OFList *list; OFEnumerator *enumerator; OFListItem iter; | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | @implementation TestsAppDelegate (OFListTests) - (void)listTests { void *pool = objc_autoreleasePoolPush(); OFList *list; OFEnumerator *enumerator; OFListItem iter; OFString *object; size_t i; bool ok; TEST(@"+[list]", (list = [OFList list])) TEST(@"-[appendObject:]", [list appendObject: strings[0]] && [list appendObject: strings[1]] && [list appendObject: strings[2]]) |
︙ | ︙ | |||
93 94 95 96 97 98 99 | [list.description isEqual: @"[\n\tFoo,\n\tBar,\n\tBaz\n]"]) TEST(@"-[objectEnumerator]", (enumerator = [list objectEnumerator])) iter = list.firstListItem; i = 0; ok = true; | | | | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | [list.description isEqual: @"[\n\tFoo,\n\tBar,\n\tBaz\n]"]) TEST(@"-[objectEnumerator]", (enumerator = [list objectEnumerator])) iter = list.firstListItem; i = 0; ok = true; while ((object = [enumerator nextObject]) != nil) { if (![object isEqual: OFListItemObject(iter)]) ok = false; iter = OFListItemNext(iter); i++; } if (list.count != i) |
︙ | ︙ | |||
117 118 119 120 121 122 123 | [list prependObject: strings[0]]; iter = list.firstListItem; i = 0; ok = true; | | | | | | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | [list prependObject: strings[0]]; iter = list.firstListItem; i = 0; ok = true; for (OFString *object_ in list) { if (![object_ isEqual: OFListItemObject(iter)]) ok = false; iter = OFListItemNext(iter); i++; } if (list.count != i) ok = false; TEST(@"Fast Enumeration", ok) ok = false; @try { for (OFString *object_ in list) { (void)object_; [list removeListItem: list.lastListItem]; } } @catch (OFEnumerationMutationException *e) { ok = true; } TEST(@"Detection of mutation during Fast Enumeration", ok) objc_autoreleasePoolPop(pool); } @end |