mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
don't call pass directly
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32614 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a1fb768e86
commit
1214410b14
3 changed files with 18 additions and 18 deletions
|
@ -147,7 +147,7 @@ int main()
|
|||
[NSNumber numberWithLongLong: LLONG_MIN],
|
||||
nil];
|
||||
a = [a sortedArrayUsingSelector: @selector(compare:)];
|
||||
pass([[a objectAtIndex: 0] longLongValue] == LLONG_MIN
|
||||
PASS([[a objectAtIndex: 0] longLongValue] == LLONG_MIN
|
||||
&& [[a objectAtIndex: 1] longLongValue] == -2
|
||||
&& [[a objectAtIndex: 2] longLongValue] == 1
|
||||
&& [[a objectAtIndex: 3] longLongValue] == 200
|
||||
|
|
|
@ -112,7 +112,7 @@ BOOL test_encoding(void)
|
|||
NSData *d = [[NSData alloc] initWithBytes: "foo" length: 3];
|
||||
NSString *s = [[stringClass alloc] initWithData: d encoding: 0];
|
||||
|
||||
pass(s == nil, "-initWithData:encoding: gives nil for invalid encodings");
|
||||
PASS(s == nil, "-initWithData:encoding: gives nil for invalid encodings")
|
||||
|
||||
DESTROY(d);
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ BOOL test_getCString_maxLength_range_remainingRange(void)
|
|||
break;
|
||||
if (buffer[j]!= 0)
|
||||
{
|
||||
pass(0, "-getCString: maxLength: %i range: remainingRange: failed",
|
||||
PASS(0, "-getCString: maxLength: %i range: remainingRange: failed",
|
||||
i);
|
||||
ok = NO;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ void test_return_self_optimizations(void)
|
|||
length: 0];
|
||||
returnValue = [string lowercaseString];
|
||||
[string release];
|
||||
pass((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
"-lowercaseString returns a valid instance");
|
||||
DESTROY(arp);
|
||||
|
||||
|
@ -242,7 +242,7 @@ void test_return_self_optimizations(void)
|
|||
length: 0];
|
||||
returnValue = [string uppercaseString];
|
||||
[string release];
|
||||
pass((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
"-uppercaseString returns a valid instance");
|
||||
DESTROY(arp);
|
||||
|
||||
|
@ -251,7 +251,7 @@ void test_return_self_optimizations(void)
|
|||
length: 0];
|
||||
returnValue = [string capitalizedString];
|
||||
[string release];
|
||||
pass((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
"-capitalizedString returns a valid instance");
|
||||
DESTROY(arp);
|
||||
|
||||
|
@ -259,7 +259,7 @@ void test_return_self_optimizations(void)
|
|||
string = [[stringClass alloc] initWithCharacters: NULL
|
||||
length: 0];
|
||||
returnValue = [string description];
|
||||
pass((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
"-description returns a valid instance");
|
||||
[string release];
|
||||
DESTROY(arp);
|
||||
|
@ -269,7 +269,7 @@ void test_return_self_optimizations(void)
|
|||
length: 0];
|
||||
returnValue = [string stringByExpandingTildeInPath];
|
||||
[string release];
|
||||
pass([@"" isEqual: returnValue], "-stringByExpandingTildeInPath returns a valid instance (1)");
|
||||
PASS([@"" isEqual: returnValue], "-stringByExpandingTildeInPath returns a valid instance (1)");
|
||||
DESTROY(arp);
|
||||
|
||||
arp = [NSAutoreleasePool new];
|
||||
|
@ -277,7 +277,7 @@ void test_return_self_optimizations(void)
|
|||
length: 1];
|
||||
returnValue = [string stringByExpandingTildeInPath];
|
||||
[string release];
|
||||
pass((IS_VALID_OBJECT(returnValue) && [@"A" isEqual: returnValue]),
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"A" isEqual: returnValue]),
|
||||
"-stringByExpandingTildeInPath returns a valid instance (2)");
|
||||
DESTROY(arp);
|
||||
|
||||
|
@ -286,7 +286,7 @@ void test_return_self_optimizations(void)
|
|||
length: 1];
|
||||
returnValue = [string stringByAbbreviatingWithTildeInPath];
|
||||
[string release];
|
||||
pass((IS_VALID_OBJECT(returnValue) && [@"A" isEqual: returnValue]),
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"A" isEqual: returnValue]),
|
||||
"-stringByAbbreviatingWithTildeInPath returns a valid instance");
|
||||
DESTROY(arp);
|
||||
|
||||
|
@ -305,9 +305,9 @@ void TestNSStringClass(Class aStringClass)
|
|||
|
||||
stringClass = aStringClass;
|
||||
|
||||
pass(test_initWithCString(), "-initWithCString: works");
|
||||
pass(test_encoding(), "character set encoding/decoding works");
|
||||
pass(test_getCString_maxLength_range_remainingRange(), "-getCString:maxLength:range:remainingRange: works");
|
||||
PASS(test_initWithCString(), "-initWithCString: works");
|
||||
PASS(test_encoding(), "character set encoding/decoding works");
|
||||
PASS(test_getCString_maxLength_range_remainingRange(), "-getCString:maxLength:range:remainingRange: works");
|
||||
|
||||
test_return_self_optimizations();
|
||||
|
||||
|
|
|
@ -15,15 +15,15 @@ int main()
|
|||
"intValue with leading space works");
|
||||
|
||||
d = [@"1.2" doubleValue];
|
||||
pass(d > 1.199999 && d < 1.200001, "simple doubleValue works");
|
||||
PASS(d > 1.199999 && d < 1.200001, "simple doubleValue works");
|
||||
d = [@"-1.2" doubleValue];
|
||||
pass(d < -1.199999 && d > -1.200001, "negative doubleValue works");
|
||||
PASS(d < -1.199999 && d > -1.200001, "negative doubleValue works");
|
||||
d = [@"+1.2" doubleValue];
|
||||
pass(d > 1.199999 && d < 1.200001, "positive doubleValue works");
|
||||
PASS(d > 1.199999 && d < 1.200001, "positive doubleValue works");
|
||||
d = [@"+1.2 x" doubleValue];
|
||||
pass(d > 1.199999 && d < 1.200001, "doubleValue ignores trailing data");
|
||||
PASS(d > 1.199999 && d < 1.200001, "doubleValue ignores trailing data");
|
||||
d = [@" 1.2" doubleValue];
|
||||
pass(d > 1.199999 && d < 1.200001, "doubleValue with leading space works");
|
||||
PASS(d > 1.199999 && d < 1.200001, "doubleValue with leading space works");
|
||||
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue