Differences From Artifact [ccb8cb8682]:
- File
tests/OFNumberTests.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 1189) [annotate] [blame] [check-ins using] [more...]
To Artifact [c5bef94b63]:
- File tests/OFNumberTests.m — part of check-in [8c32791836] at 2020-09-04 16:39:06 on branch tagged-pointers — OFNumber: Add support for tagged pointers (user: js, size: 3039) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
34 35 36 37 38 39 40 41 42 43 44 | [num isEqual: [OFNumber numberWithLong: 123456789]]) TEST(@"-[hash]", num.hash == 0x82D8BC42) TEST(@"-[charValue]", num.charValue == 21) TEST(@"-[doubleValue]", num.doubleValue == 123456789.L) objc_autoreleasePoolPop(pool); } @end | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 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 92 93 94 | [num isEqual: [OFNumber numberWithLong: 123456789]]) TEST(@"-[hash]", num.hash == 0x82D8BC42) TEST(@"-[charValue]", num.charValue == 21) TEST(@"-[doubleValue]", num.doubleValue == 123456789.L) TEST(@"signed char minimum & maximum unmodified", (num = [OFNumber numberWithChar: SCHAR_MIN]) && num.charValue == SCHAR_MIN && (num = [OFNumber numberWithChar: SCHAR_MAX]) && num.charValue == SCHAR_MAX) TEST(@"short minimum & maximum unmodified", (num = [OFNumber numberWithShort: SHRT_MIN]) && num.shortValue == SHRT_MIN && (num = [OFNumber numberWithShort: SHRT_MAX]) && num.shortValue == SHRT_MAX) TEST(@"int minimum & maximum unmodified", (num = [OFNumber numberWithInt: INT_MIN]) && num.intValue == INT_MIN && (num = [OFNumber numberWithInt: INT_MAX]) && num.intValue == INT_MAX) TEST(@"long minimum & maximum unmodified", (num = [OFNumber numberWithLong: LONG_MIN]) && num.longValue == LONG_MIN && (num = [OFNumber numberWithLong: LONG_MAX]) && num.longValue == LONG_MAX) TEST(@"long long minimum & maximum unmodified", (num = [OFNumber numberWithLongLong: LLONG_MIN]) && num.longLongValue == LLONG_MIN && (num = [OFNumber numberWithLongLong: LLONG_MAX]) && num.longLongValue == LLONG_MAX) TEST(@"unsigned char maximum unmodified", (num = [OFNumber numberWithUnsignedChar: UCHAR_MAX]) && num.unsignedCharValue == UCHAR_MAX) TEST(@"unsigned short maximum unmodified", (num = [OFNumber numberWithUnsignedShort: USHRT_MAX]) && num.unsignedShortValue == USHRT_MAX) TEST(@"unsigned int maximum unmodified", (num = [OFNumber numberWithUnsignedInt: UINT_MAX]) && num.unsignedIntValue == UINT_MAX) TEST(@"unsigned long maximum unmodified", (num = [OFNumber numberWithUnsignedLong: ULONG_MAX]) && num.unsignedLongValue == ULONG_MAX) TEST(@"unsigned long long maximum unmodified", (num = [OFNumber numberWithUnsignedLongLong: ULLONG_MAX]) && num.unsignedLongLongValue == ULLONG_MAX) objc_autoreleasePoolPop(pool); } @end |