Differences From Artifact [fe0644a99a]:
- File tests/OFStringTests.m — part of check-in [7561b9244e] at 2013-10-30 00:09:39 on branch trunk — OFStringTests: Fix a path test on Win32. (user: js, size: 24278) [annotate] [blame] [check-ins using]
To Artifact [14295c4581]:
- File
tests/OFStringTests.m
— part of check-in
[a0b63a8df4]
at
2013-12-01 02:08:43
on branch trunk
— Port to DOS/DJGPP.
The port was much easier than expected. The only changes that were
required were defining the missing lrint() and useconds_t, the rest was
optional (like using backslashes for paths, even though slashes work
fine). (user: js, size: 24375) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
281 282 283 284 285 286 287 | [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"]) TEST(@"+[pathWithComponents:]", (is = [OFString pathWithComponents: [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]]) && | | | 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"]) TEST(@"+[pathWithComponents:]", (is = [OFString pathWithComponents: [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]]) && #if !defined(_WIN32) && !defined(__DJGPP__) [is isEqual: @"foo/bar/baz"] && #else [is isEqual: @"foo\\bar\\baz"] && #endif (is = [OFString pathWithComponents: [OFArray arrayWithObjects: @"foo", nil]]) && [is isEqual: @"foo"]) |
︙ | ︙ | |||
345 346 347 348 349 350 351 | [[@"foo" stringByDeletingLastPathComponent] isEqual: @"."]) TEST(@"-[stringByDeletingPathExtension]", [[@"foo.bar" stringByDeletingPathExtension] isEqual: @"foo"] && [[@"foo..bar" stringByDeletingPathExtension] isEqual: @"foo."] && [[@"/foo./bar" stringByDeletingPathExtension] isEqual: @"/foo./bar"] && | | | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | [[@"foo" stringByDeletingLastPathComponent] isEqual: @"."]) TEST(@"-[stringByDeletingPathExtension]", [[@"foo.bar" stringByDeletingPathExtension] isEqual: @"foo"] && [[@"foo..bar" stringByDeletingPathExtension] isEqual: @"foo."] && [[@"/foo./bar" stringByDeletingPathExtension] isEqual: @"/foo./bar"] && #if !defined(_WIN32) && !defined(__DJGPP__) [[@"/foo./bar.baz" stringByDeletingPathExtension] isEqual: @"/foo./bar"] && #else [[@"/foo./bar.baz" stringByDeletingPathExtension] isEqual: @"\\foo.\\bar"] && #endif [[@"foo.bar/" stringByDeletingPathExtension] isEqual: @"foo"] && |
︙ | ︙ | |||
380 381 382 383 384 385 386 | */ TEST(@"-[floatValue]", [@"\t-0.25 " floatValue] == -0.25 && [@"\r-INFINITY\n" floatValue] == -INFINITY && isnan([@" NAN\t\t" floatValue])) TEST(@"-[doubleValue]", | | | | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | */ TEST(@"-[floatValue]", [@"\t-0.25 " floatValue] == -0.25 && [@"\r-INFINITY\n" floatValue] == -INFINITY && isnan([@" NAN\t\t" floatValue])) TEST(@"-[doubleValue]", #if !defined(__ANDROID__) && !defined(__DJGPP__) [@"\t-0x1.FFFFFFFFFFFFFP-1020 " doubleValue] == -0x1.FFFFFFFFFFFFFP-1020 && #else /* Android and DJGPPP do not accept 0x for strtod() */ [@"\t-0.123456789 " doubleValue] == -0.123456789 && #endif [@"\r-INFINITY\n" doubleValue] == -INFINITY && isnan([@" NAN\t\t" doubleValue])) EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #1", OFInvalidFormatException, [@"abc" decimalValue]) |
︙ | ︙ |