ObjFW  Check-in [b9803c90d0]

Overview
Comment:Use a value in the -[doubleValue] test that only fits into a double.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b9803c90d05cb4e60ee2820c9bcc45cc0c1ad7d921ddbdef6cd9ee6d346e869a
User & Date: js on 2011-03-29 19:22:24
Other Links: manifest | tags
Context
2011-03-29
19:27
Fix missing include in OFBlock.m for the Apple 32 bit runtime. check-in: ac7830ff4f user: js tags: trunk
19:22
Use a value in the -[doubleValue] test that only fits into a double. check-in: b9803c90d0 user: js tags: trunk
19:03
Add -[floatValue] and -[doubleValue]. check-in: 9c59bc9aee user: js tags: trunk
Changes

Modified tests/OFStringTests.m from [c949c30655] to [f41872f1e2].

302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
	 */
	TEST(@"-[floatValue]",
	    [@"\t-0.25 " floatValue] == -0.25 &&
	    [@"\r-INFINITY\n" floatValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" floatValue]))

	TEST(@"-[doubleValue]",
	    [@"\t-0.000000059604644775390625 " doubleValue] ==
	    -0.000000059604644775390625L &&
	    [@"\r-INFINITY\n" doubleValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" doubleValue]))

	EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #1",
	    OFInvalidFormatException, [@"abc" decimalValue])
	EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #2",
	    OFInvalidFormatException, [@"0a" decimalValue])







|
|







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
	 */
	TEST(@"-[floatValue]",
	    [@"\t-0.25 " floatValue] == -0.25 &&
	    [@"\r-INFINITY\n" floatValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" floatValue]))

	TEST(@"-[doubleValue]",
	    [@"\t-0x1.FFFFFFFFFFFFFP-1020 " doubleValue] ==
	    -0x1.FFFFFFFFFFFFFP-1020 &&
	    [@"\r-INFINITY\n" doubleValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" doubleValue]))

	EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #1",
	    OFInvalidFormatException, [@"abc" decimalValue])
	EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #2",
	    OFInvalidFormatException, [@"0a" decimalValue])