Differences From Artifact [5b2a9f8f8f]:
- File
tests/OFDataTests.m
— part of check-in
[8ebb5ff462]
at
2021-01-15 19:06:51
on branch trunk
— OFDataTests: Don't assign structs inside R()
This is broken in GCC 7.5.0 on HP-UX targeting HPPA64. (user: js, size: 6879) [annotate] [blame] [check-ins using]
To Artifact [5c0a7f22cc]:
- File tests/OFDataTests.m — part of check-in [1b82d3bf4f] at 2021-03-07 20:25:21 on branch trunk — *.m: Fold methods into one line where it fits (user: js, size: 6820) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
61 62 63 64 65 66 67 | (mutable = [[immutable mutableCopy] autorelease]) && [mutable isEqual: immutable]) TEST(@"-[compare]", [mutable compare: immutable] == 0 && R([mutable removeLastItem]) && [immutable compare: mutable] == OF_ORDERED_DESCENDING && [mutable compare: immutable] == OF_ORDERED_ASCENDING && | | < | < | < | < < | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | (mutable = [[immutable mutableCopy] autorelease]) && [mutable isEqual: immutable]) TEST(@"-[compare]", [mutable compare: immutable] == 0 && R([mutable removeLastItem]) && [immutable compare: mutable] == OF_ORDERED_DESCENDING && [mutable compare: immutable] == OF_ORDERED_ASCENDING && [[OFData dataWithItems: "aa" count: 2] compare: [OFData dataWithItems: "z" count: 1]] == OF_ORDERED_ASCENDING) TEST(@"-[hash]", immutable.hash == 0x634A529F) mutable = [OFMutableData dataWithItems: "abcdef" count: 6]; TEST(@"-[removeLastItem]", R([mutable removeLastItem]) && mutable.count == 5 && memcmp(mutable.items, "abcde", 5) == 0) TEST(@"-[removeItemsInRange:]", R([mutable removeItemsInRange: of_range(1, 2)]) && mutable.count == 3 && memcmp(mutable.items, "ade", 3) == 0) TEST(@"-[insertItems:atIndex:count:]", R([mutable insertItems: "bc" atIndex: 1 count: 2]) && mutable.count == 5 && memcmp(mutable.items, "abcde", 5) == 0) immutable = [OFData dataWithItems: "aaabaccdacaabb" count: 7 itemSize: 2]; range = [immutable rangeOfData: [OFData dataWithItems: "aa" count: 1 |
︙ | ︙ | |||
196 197 198 199 200 201 202 | [mutable.stringByBase64Encoding isEqual: @"YWJjZGU="]) TEST(@"+[dataWithBase64EncodedString:]", memcmp([[OFData dataWithBase64EncodedString: @"YWJjZGU="] items], "abcde", 5) == 0) TEST(@"Building strings", | | < | < | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | [mutable.stringByBase64Encoding isEqual: @"YWJjZGU="]) TEST(@"+[dataWithBase64EncodedString:]", memcmp([[OFData dataWithBase64EncodedString: @"YWJjZGU="] items], "abcde", 5) == 0) TEST(@"Building strings", (mutable = [OFMutableData dataWithItems: str count: 6]) && R([mutable addItem: ""]) && strcmp(mutable.items, str) == 0) EXPECT_EXCEPTION(@"Detect out of range in -[itemAtIndex:]", OFOutOfRangeException, [mutable itemAtIndex: mutable.count]) EXPECT_EXCEPTION(@"Detect out of range in -[addItems:count:]", OFOutOfRangeException, [mutable addItems: raw[0] count: SIZE_MAX]) EXPECT_EXCEPTION(@"Detect out of range in -[removeItemsInRange:]", OFOutOfRangeException, [mutable removeItemsInRange: of_range(mutable.count, 1)]) free(raw[0]); free(raw[1]); objc_autoreleasePoolPop(pool); } @end |