mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Tidy up use of white space so we have it after if/for/while and not after (
or before ) or padding at end of line. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c5f49ccbcb
commit
0708409c1b
180 changed files with 2181 additions and 2156 deletions
|
@ -11,7 +11,7 @@
|
|||
#include <Foundation/NSString.h>
|
||||
#include "LoadMe.h"
|
||||
|
||||
@implementation LoadMe
|
||||
@implementation LoadMe
|
||||
|
||||
- init
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "SecondClass.h"
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
@implementation SecondClass
|
||||
@implementation SecondClass
|
||||
|
||||
- init
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
/* Beginning of some parameters to vary. */
|
||||
/* 0 and 0 works.
|
||||
/* 0 and 0 works.
|
||||
1 and 0 works for the first test, but has no way of getting the
|
||||
super_foo in second test right, because we haven't resolved the
|
||||
forward reference when -awakeAfterUsingCoder is called; this is
|
||||
|
@ -137,7 +137,7 @@ int SubFoo_awakeAfterUsingCoder_substitutes = 1;
|
|||
@end
|
||||
|
||||
|
||||
@implementation Foo
|
||||
@implementation Foo
|
||||
|
||||
- init
|
||||
{
|
||||
|
@ -211,7 +211,7 @@ int SubFoo_awakeAfterUsingCoder_substitutes = 1;
|
|||
|
||||
@end
|
||||
|
||||
/* Test the use of -encodeConditional to encode a forward reference
|
||||
/* Test the use of -encodeConditional to encode a forward reference
|
||||
to an object. */
|
||||
void
|
||||
test_fref ()
|
||||
|
|
|
@ -129,7 +129,7 @@ int main ()
|
|||
NSLog(@"%@", s);
|
||||
x = [s propertyList];
|
||||
NSLog(@"%d", [o isEqual: x]);
|
||||
|
||||
|
||||
|
||||
test1();
|
||||
test2();
|
||||
|
@ -153,7 +153,7 @@ int main (int argc, char **argv)
|
|||
id pool = [NSAutoreleasePool new];
|
||||
NSProcessInfo *info = [NSProcessInfo processInfo];
|
||||
NSUserDefaults *defaults;
|
||||
|
||||
|
||||
NSLog(@"Temporary directory - %@", NSTemporaryDirectory());
|
||||
[info setProcessName: @"TestProcess"];
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
|
|
@ -100,9 +100,9 @@ bench_object()
|
|||
}
|
||||
END_TIMER;
|
||||
PRINT_TIMER("Class: 10 class method calls\t\t");
|
||||
|
||||
|
||||
obj = [MyObject new];
|
||||
|
||||
|
||||
START_TIMER;
|
||||
for (i = 0; i < MAX_COUNT * 10; i++)
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ bench_object()
|
|||
}
|
||||
END_TIMER;
|
||||
PRINT_TIMER_NO_BASELINE("Category: 10 super calls\t\t");
|
||||
|
||||
|
||||
START_TIMER;
|
||||
for (i = 0; i < MAX_COUNT; i++)
|
||||
{
|
||||
|
@ -257,7 +257,7 @@ bench_array()
|
|||
int i;
|
||||
id array;
|
||||
NSString *strings[MAX_COUNT];
|
||||
|
||||
|
||||
AUTO_START;
|
||||
for (i = 0; i < MAX_COUNT; i++)
|
||||
{
|
||||
|
@ -309,7 +309,7 @@ bench_dict()
|
|||
id obj2;
|
||||
NSString *keys[MAX_COUNT/10];
|
||||
NSString *vals[MAX_COUNT/10];
|
||||
|
||||
|
||||
AUTO_START;
|
||||
for (i = 0; i < MAX_COUNT/10; i++)
|
||||
{
|
||||
|
@ -407,7 +407,7 @@ bench_str()
|
|||
[NSData dataWithBytes: "hello" length: 5], @"Key8",
|
||||
nil];
|
||||
plstr = [plist description];
|
||||
|
||||
|
||||
printf("NSString\n");
|
||||
|
||||
START_TIMER;
|
||||
|
@ -577,7 +577,7 @@ bench_date()
|
|||
printf("NSCalendarDate\n");
|
||||
START_TIMER;
|
||||
for (i = 0; i < MAX_COUNT/10; i++)
|
||||
{
|
||||
{
|
||||
d = [[dateClass alloc] init];
|
||||
[d description];
|
||||
[d dayOfYear];
|
||||
|
@ -600,7 +600,7 @@ bench_data()
|
|||
printf("NSData\n");
|
||||
START_TIMER;
|
||||
for (i = 0; i < MAX_COUNT/10; i++)
|
||||
{
|
||||
{
|
||||
d = [[dataClass alloc] initWithContentsOfFile:@"benchmark.m"];
|
||||
[d length];
|
||||
o = [d copy];
|
||||
|
@ -623,12 +623,12 @@ int main(int argc, char *argv[], char **env)
|
|||
#endif
|
||||
|
||||
/*
|
||||
* Cache classes to remove overhead of objc runtime class lookup from
|
||||
* Cache classes to remove overhead of objc runtime class lookup from
|
||||
* the benchmark.
|
||||
*/
|
||||
rootClass = [NSObject class];
|
||||
stringClass = [NSString class];
|
||||
|
||||
|
||||
pool = [NSAutoreleasePool new];
|
||||
printf(" Test \t\t\t\t time (sec) \t index\n");
|
||||
bench_object();
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* call - Program to test NSFileHandle TCP/IP connection.
|
||||
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||
Date: Jun 2002
|
||||
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
*/
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ int main(int argc, char *argv[])
|
|||
id arp;
|
||||
int i;
|
||||
Class cstream_class;
|
||||
|
||||
|
||||
if (argc > 1)
|
||||
cstream_class = objc_get_class (argv[1]);
|
||||
else
|
||||
|
@ -33,7 +33,7 @@ int main(int argc, char *argv[])
|
|||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
[array addObject: [NSNumber numberWithInt: i]];
|
||||
[dictionary putObject: [NSNumber numberWithInt: i]
|
||||
[dictionary putObject: [NSNumber numberWithInt: i]
|
||||
atKey: [NSNumber numberWithInt: i*i]];
|
||||
}
|
||||
[array printForDebugger];
|
||||
|
@ -41,12 +41,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Write them to a file */
|
||||
|
||||
/* Create an instances of the Archiver class, specify that we
|
||||
/* Create an instances of the Archiver class, specify that we
|
||||
want human-readable "Text"-style, instead of "Binary"-style
|
||||
coding. */
|
||||
archiver = [[Archiver alloc] initForWritingToFile: @"./coder.dat"
|
||||
withCStreamClass: cstream_class];
|
||||
[archiver encodeObject: array
|
||||
[archiver encodeObject: array
|
||||
withName: @"Test Array"];
|
||||
[archiver encodeObject: dictionary
|
||||
withName: @"Test Dictionary"];
|
||||
|
@ -95,6 +95,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Do the autorelease. */
|
||||
[arp release];
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (BOOL) respondsToSelector: (SEL) aSelector
|
||||
{
|
||||
BOOL ret = [super respondsToSelector: aSelector];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
diningPhilosophers.h
|
||||
|
||||
Five hungry philosophers testing locks and threads
|
||||
|
@ -8,14 +8,14 @@
|
|||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
|
||||
|
||||
This file is part of the GNUstep Application Kit Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -23,11 +23,11 @@
|
|||
|
||||
If you are interested in a warranty or support for this source code,
|
||||
contact Scott Christley <scottc@net-community.com> for more information.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
|
@ -126,7 +126,7 @@ int main()
|
|||
// Create the locks
|
||||
for (i = 0;i < 5; ++i)
|
||||
{
|
||||
forks[i] = [[NSConditionLock alloc]
|
||||
forks[i] = [[NSConditionLock alloc]
|
||||
initWithCondition:NO_FOOD];
|
||||
[forks[i] lock];
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ int main()
|
|||
[fork_lock unlockWithCondition:FOOD_SERVED];
|
||||
for (i = 0;i < 5; ++i)
|
||||
[forks[i] unlockWithCondition:FOOD_SERVED];
|
||||
|
||||
|
||||
while (1);
|
||||
[arp release];
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation Foo
|
||||
@implementation Foo
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
|
@ -122,7 +122,7 @@
|
|||
|
||||
@end
|
||||
|
||||
/* Test the use of -encodeConditional to encode a forward reference
|
||||
/* Test the use of -encodeConditional to encode a forward reference
|
||||
to an object. */
|
||||
void
|
||||
test_fref ()
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -307,7 +307,7 @@ test_behavior1(void)
|
|||
GSObjCAddClassBehavior(myTmplClass, [MyClass class]);
|
||||
NSCAssert([myTmplObj respondsToSelector:@selector(text)] == YES,
|
||||
@"Behavior failed");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -325,7 +325,7 @@ test_behavior2(void)
|
|||
GSObjCAddClassBehavior(myTmplClass, [MyClass class]);
|
||||
NSCAssert([myTmplObj respondsToSelector:@selector(myClassCategory1)] == YES,
|
||||
@"Behavior failed");
|
||||
|
||||
|
||||
NSCAssert(strcmp([myTmplObj text], "template_main") == 0,
|
||||
@"Overwritten existing implementation!");
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -42,7 +42,7 @@ volatile int counter = 0;
|
|||
volatile int threadExitCounter;
|
||||
|
||||
void
|
||||
wait_a_while()
|
||||
wait_a_while ()
|
||||
{
|
||||
volatile int i;
|
||||
for (i = 0; i < 5; i++)
|
||||
|
@ -73,7 +73,7 @@ wait_a_while()
|
|||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
makeMulti = ([ident isEqualToString: @"Make Multithreaded GS"]);
|
||||
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
start = [NSDate date];
|
||||
|
@ -84,7 +84,7 @@ wait_a_while()
|
|||
[lock lock];
|
||||
|
||||
temp = counter;
|
||||
wait_a_while();
|
||||
wait_a_while ();
|
||||
|
||||
if (makeMulti && i == 49 )
|
||||
{
|
||||
|
@ -96,14 +96,14 @@ wait_a_while()
|
|||
|
||||
|
||||
counter = temp + 1;
|
||||
wait_a_while();
|
||||
wait_a_while ();
|
||||
|
||||
[lock unlock];
|
||||
}
|
||||
end = [NSDate date];
|
||||
time += [end timeIntervalSinceDate: start];
|
||||
}
|
||||
NSLog(@"End (%@/%@/%@):%f ",
|
||||
NSLog(@"End (%@/%@/%@):%f ",
|
||||
[NSThread currentThread], ident, lock, time / 100 );
|
||||
|
||||
threadExitCounter++;
|
||||
|
@ -183,9 +183,9 @@ test_lazyLocks()
|
|||
while (threadExitCounter < 3)
|
||||
[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 10.0]];
|
||||
|
||||
NSCAssert1 (counter == NUM_ITERATIONS * 1300,
|
||||
NSCAssert1 (counter == NUM_ITERATIONS * 1300,
|
||||
@"Locks broken! %d", counter );
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -199,7 +199,7 @@ test_newLockAt(void)
|
|||
toTarget: t
|
||||
withObject: nil];
|
||||
|
||||
[cLock lockWhenCondition: YES
|
||||
[cLock lockWhenCondition: YES
|
||||
beforeDate: [NSDate dateWithTimeIntervalSinceNow: 10.0]];
|
||||
[cLock unlock];
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ int main()
|
|||
assert ([s1 intValue] == [s2 intValue]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
|
||||
[heap release];
|
||||
[array release];
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@ int main()
|
|||
id apl;
|
||||
tstruct ss;
|
||||
tstruct tt;
|
||||
|
||||
|
||||
[NSAutoreleasePool enableDoubleReleaseCheck:YES];
|
||||
|
||||
|
||||
arp = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
/* Create a Set of int's */
|
||||
|
@ -64,7 +64,7 @@ int main()
|
|||
{
|
||||
id o, e = [set objectEnumerator];
|
||||
while ((o = [e nextObject]))
|
||||
printf("%s\n", [[o description] cString]);
|
||||
printf("%s\n", [[o description] cString]);
|
||||
}
|
||||
|
||||
apl = [[NSAutoreleasePool alloc] init];
|
||||
|
@ -119,7 +119,7 @@ printf("%u\n", [arc retainCount]);
|
|||
{
|
||||
id o, e = [set objectEnumerator];
|
||||
while ((o = [e nextObject]))
|
||||
printf("%s\n", [[o description] cString]);
|
||||
printf("%s\n", [[o description] cString]);
|
||||
}
|
||||
|
||||
obj = [ClassOne new];
|
||||
|
@ -174,7 +174,7 @@ printf("%u\n", [arc retainCount]);
|
|||
|
||||
/* Do the autorelease. */
|
||||
[arp release];
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ main()
|
|||
printf("Error: count != 1\n");
|
||||
|
||||
printf("Method: +arrayWithObjects:...\n");
|
||||
c = [NSArray arrayWithObjects:
|
||||
c = [NSArray arrayWithObjects:
|
||||
[NSObject class],
|
||||
[NSArray class],
|
||||
[NSMutableArray class],
|
||||
|
@ -153,7 +153,7 @@ main()
|
|||
g = [f sortedArrayUsingSelector: @selector(compare:)];
|
||||
printf("Method: -sortedArrayUsingFunction:context:\n");
|
||||
h = [f sortedArrayUsingFunction: compare context: NULL];
|
||||
|
||||
|
||||
enumerator = [g objectEnumerator];
|
||||
while ((i = [enumerator nextObject]))
|
||||
printf("%s ", [i cString]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
test.m
|
||||
|
||||
Test NSAttributedString and NSMutableAttributedString classes
|
||||
|
@ -7,14 +7,14 @@
|
|||
|
||||
Written by: ANOQ of the sun <anoq@vip.cybercity.dk>
|
||||
Date: June 1997
|
||||
|
||||
|
||||
This file is part of ...
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
If you are interested in a warranty or support for this source code,
|
||||
contact Scott Christley <scottc@net-community.com> for more information.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
|
@ -48,17 +48,17 @@ void printAttrString(NSAttributedString *attrStr)
|
|||
NSString *tmpStr;
|
||||
NSRange effectiveRange;
|
||||
unsigned int tmpLength;
|
||||
|
||||
|
||||
effectiveRange = NSMakeRange(0,0);
|
||||
tmpLength = [attrStr length];
|
||||
puts("Attributed string looks like this:");
|
||||
while(NSMaxRange(effectiveRange) < tmpLength)
|
||||
while (NSMaxRange(effectiveRange) < tmpLength)
|
||||
{
|
||||
tmpAttrDict = [attrStr attributesAtIndex:NSMaxRange(effectiveRange)
|
||||
effectiveRange:&effectiveRange];
|
||||
printf("String: %s attributes: ",[[attrStr string] cString]);
|
||||
keyEnumerator = [tmpAttrDict keyEnumerator];
|
||||
while((tmpStr = [keyEnumerator nextObject]))
|
||||
while ((tmpStr = [keyEnumerator nextObject]))
|
||||
printf("%s ",[tmpStr cString]);
|
||||
printf("location: %ld length: %ld\n",
|
||||
(long)effectiveRange.location,
|
||||
|
@ -91,7 +91,7 @@ void testAttributedString(void)
|
|||
[twoAttributes addEntriesFromDictionary:attributes];
|
||||
[twoAttributes setObject:@"red NSColor"
|
||||
forKey:NSBackgroundColorAttributeName];
|
||||
|
||||
|
||||
attrString = [[NSAttributedString alloc]
|
||||
initWithString:@"Attributed string test"
|
||||
attributes:twoAttributes];
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* nsbundle - Program to test out dynamic linking via NSBundle.
|
||||
Copyright (C) 1993,1994,1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
||||
Date: Jul 1995
|
||||
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
|
||||
*/
|
||||
#ifndef __MINGW32__
|
||||
#include <sys/param.h>
|
||||
|
@ -20,8 +20,8 @@
|
|||
#include "SecondClass.h"
|
||||
#include "MyCategory.h"
|
||||
|
||||
int
|
||||
main(int argc, char *argv[], char **env)
|
||||
int
|
||||
main(int argc, char *argv[], char **env)
|
||||
{
|
||||
NSBundle *bundle;
|
||||
NSString *path;
|
||||
|
@ -32,7 +32,7 @@ main(int argc, char *argv[], char **env)
|
|||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
arp = [NSAutoreleasePool new];
|
||||
|
||||
|
||||
setbuf(stdout, 0);
|
||||
/* Test bundle version and info files */
|
||||
bundle = [NSBundle bundleForLibrary: @"gnustep-base"];
|
||||
|
@ -95,7 +95,7 @@ main(int argc, char *argv[], char **env)
|
|||
fprintf(stdout, " or there is no dynamic loader on your system\n");
|
||||
exit(1);
|
||||
NS_ENDHANDLER
|
||||
if (!object)
|
||||
if (!object)
|
||||
{
|
||||
printf("* ERROR: Can't find principal class\n");
|
||||
}
|
||||
|
|
|
@ -18,28 +18,28 @@ id myServer;
|
|||
NSAutoreleasePool *pool;
|
||||
NSConnection *serverConnection;
|
||||
Tester *serverObject;
|
||||
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
|
||||
serverConnection = [NSConnection
|
||||
connectionWithReceivePort: [portArray objectAtIndex: 0]
|
||||
sendPort: [portArray objectAtIndex: 1]];
|
||||
|
||||
|
||||
serverObject = [[self alloc] init];
|
||||
[(id)[serverConnection rootProxy] setServer: serverObject];
|
||||
[serverObject release];
|
||||
|
||||
|
||||
[[NSRunLoop currentRunLoop] run];
|
||||
[pool release];
|
||||
[NSThread exit];
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
+ (void) setServer: (id)anObject
|
||||
{
|
||||
myServer = [anObject retain];
|
||||
NSLog(@"Got %d", [myServer doIt]);
|
||||
NSLog(@"Got %d", [myServer doIt]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ id myServer;
|
|||
|
||||
port1 = [NSPort port];
|
||||
port2 = [NSPort port];
|
||||
|
||||
|
||||
conn = [[NSConnection alloc] initWithReceivePort: port1 sendPort: port2];
|
||||
[conn setRootObject: self];
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ int con_data (id prx)
|
|||
struct myarray ma = {{55,66,77}};
|
||||
|
||||
printf("Testing data sending\n");
|
||||
|
||||
|
||||
printf("Boolean:\n");
|
||||
b = YES;
|
||||
printf(" sending %d", b);
|
||||
|
@ -190,7 +190,7 @@ int con_data (id prx)
|
|||
[prx getString: &str];
|
||||
printf(" got (%s)\n", str);
|
||||
[pool release];
|
||||
|
||||
|
||||
pool = [NSAutoreleasePool new];
|
||||
printf("Small Struct:\n");
|
||||
//printf(" sending %x", small.z);
|
||||
|
@ -336,7 +336,7 @@ con_benchmark (id prx)
|
|||
NSMutableData *sen = [NSMutableData data];
|
||||
id localObj;
|
||||
id rep;
|
||||
|
||||
|
||||
printf("Benchmarking\n");
|
||||
[sen setLength: 100000];
|
||||
rep = [prx sendObject: sen];
|
||||
|
@ -355,7 +355,7 @@ con_benchmark (id prx)
|
|||
#endif
|
||||
[prx echoObject: localObj];
|
||||
}
|
||||
|
||||
|
||||
printf(" Delay is %f\n", [d timeIntervalSinceNow]);
|
||||
printf("Done\n");
|
||||
return 0;
|
||||
|
@ -424,7 +424,7 @@ con_objects (id prx)
|
|||
for (j = 0; j < k; j++)
|
||||
{
|
||||
id remote_peer_obj = [prx objectAt:j];
|
||||
printf("triangle %d object proxy's hash is 0x%x\n",
|
||||
printf("triangle %d object proxy's hash is 0x%x\n",
|
||||
j, (unsigned)[remote_peer_obj hash]);
|
||||
|
||||
#if 0
|
||||
|
@ -433,7 +433,7 @@ con_objects (id prx)
|
|||
[remote_peer_obj release];
|
||||
#endif
|
||||
remote_peer_obj = [prx objectAt:j];
|
||||
printf("repeated triangle %d object proxy's hash is 0x%x\n",
|
||||
printf("repeated triangle %d object proxy's hash is 0x%x\n",
|
||||
j, (unsigned)[remote_peer_obj hash]);
|
||||
}
|
||||
return 0;
|
||||
|
@ -505,7 +505,7 @@ int main (int argc, char *argv[], char **env)
|
|||
type_test = 0;
|
||||
stats = 0;
|
||||
while ((c = getopt(argc, argv, "hdtbmslocr")) != EOF)
|
||||
switch (c)
|
||||
switch (c)
|
||||
{
|
||||
case 'd':
|
||||
debug++;
|
||||
|
@ -565,7 +565,7 @@ int main (int argc, char *argv[], char **env)
|
|||
if (optind < argc)
|
||||
{
|
||||
if (optind+1 < argc)
|
||||
prx = [NSConnection rootProxyForConnectionWithRegisteredName:
|
||||
prx = [NSConnection rootProxyForConnectionWithRegisteredName:
|
||||
[NSString stringWithCString: argv[optind+1]]
|
||||
host: [NSString stringWithCString:argv[optind]]];
|
||||
else
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
- (void) getBoolean: (BOOL*)bp
|
||||
{
|
||||
BOOL rbp = !(*bp);
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)*bp, (int)rbp);
|
||||
fflush(stdout);
|
||||
*bp = rbp;
|
||||
|
@ -112,7 +112,7 @@
|
|||
- (unsigned char) sendUChar: (unsigned char)num
|
||||
{
|
||||
unsigned char rnum = num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)num, (int)rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
|
@ -122,7 +122,7 @@
|
|||
- (void) getUChar: (unsigned char *)num
|
||||
{
|
||||
unsigned char rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)(*num), (int)rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
|
@ -140,7 +140,7 @@
|
|||
- (void) getChar: (char *)num
|
||||
{
|
||||
char rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)(*num), (int)rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
|
@ -158,7 +158,7 @@
|
|||
- (void) getShort: (short *)num
|
||||
{
|
||||
short rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %hd, returning %hd\n", GSNameFromSelector(_cmd),
|
||||
printf("(%s) got %hd, returning %hd\n", GSNameFromSelector(_cmd),
|
||||
(*num), rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
|
@ -271,7 +271,7 @@
|
|||
|
||||
- sendObject: (id)str
|
||||
{
|
||||
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
|
||||
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
|
||||
GSClassNameFromObject(str));
|
||||
fflush(stdout);
|
||||
return str;
|
||||
|
@ -279,7 +279,7 @@
|
|||
|
||||
- (void) getObject: (id *)str
|
||||
{
|
||||
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
|
||||
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
|
||||
GSClassNameFromObject(*str));
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ int main(int argc, char *argv[], char **env)
|
|||
debug = 0;
|
||||
timeout = 0;
|
||||
while ((i = getopt(argc, argv, "hdt:")) != EOF)
|
||||
switch (i)
|
||||
switch (i)
|
||||
{
|
||||
case 'd':
|
||||
debug++;
|
||||
|
|
|
@ -44,25 +44,25 @@ if ([(NSDate*) [NSCalendarDate date] compare:
|
|||
a = [NSDate date];
|
||||
printf("+[date] -- %s\n", [DESCRIP(a) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSinceNow: 0];
|
||||
printf("+[dateWithTimeIntervalSinceNow: 0] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSinceNow: 0] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSinceNow: 600];
|
||||
printf("+[dateWithTimeIntervalSinceNow: 600] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSinceNow: 600] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSince1970: 0];
|
||||
printf("+[dateWithTimeIntervalSince1970: 0] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSince1970: 0] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSince1970: -600];
|
||||
printf("+[dateWithTimeIntervalSince1970: -600] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSince1970: -600] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSinceReferenceDate: 0];
|
||||
printf("+[dateWithTimeIntervalSinceReferenceDate: 0] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSinceReferenceDate: 0] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSinceReferenceDate: 300];
|
||||
printf("+[dateWithTimeIntervalSinceReferenceDate: 300] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSinceReferenceDate: 300] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
b = [NSDate dateWithTimeIntervalSinceNow: 24*60*40];
|
||||
printf("+[dateWithTimeIntervalSinceNow: 0] -- %s\n",
|
||||
printf("+[dateWithTimeIntervalSinceNow: 0] -- %s\n",
|
||||
[DESCRIP(b) cString]);
|
||||
|
||||
// Comparisons
|
||||
|
@ -114,7 +114,7 @@ if ([(NSDate*) [NSCalendarDate date] compare:
|
|||
a = [c absoluteGregorianDay: 9 month: 10 year: 1996];
|
||||
printf("%d-%d-%d is Gregorian absolute %d\n", 9, 10, 1996, a);
|
||||
printf("-[dayOfCommonEra] %d\n", [c dayOfCommonEra]);
|
||||
printf("-[timeIntervalSinceReferenceDate] %f\n",
|
||||
printf("-[timeIntervalSinceReferenceDate] %f\n",
|
||||
[c timeIntervalSinceReferenceDate]);
|
||||
|
||||
a = [c absoluteGregorianDay: 1 month: 1 year: 2001];
|
||||
|
@ -134,12 +134,12 @@ if ([(NSDate*) [NSCalendarDate date] compare:
|
|||
printf("-[monthOfYear] %d\n", [c monthOfYear]);
|
||||
printf("-[secondOfMinute] %d\n", [c secondOfMinute]);
|
||||
printf("-[yearOfCommonEra] %d\n", [c yearOfCommonEra]);
|
||||
printf("-[timeIntervalSinceReferenceDate] %f\n",
|
||||
printf("-[timeIntervalSinceReferenceDate] %f\n",
|
||||
[c timeIntervalSinceReferenceDate]);
|
||||
e = [NSCalendarDate dateWithString: @"1996-10-09 0:00:0"
|
||||
calendarFormat: @"%Y-%m-%d %H:%M:%S"];
|
||||
printf("calendar date %s\n", [[e description] cString]);
|
||||
printf("-[timeIntervalSinceReferenceDate] %f\n",
|
||||
printf("-[timeIntervalSinceReferenceDate] %f\n",
|
||||
[e timeIntervalSinceReferenceDate]);
|
||||
printf("NSCalendrical time tests\n");
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ main(int argc, char** argv, char** envp)
|
|||
[d1 setObject:o1 forKey:o1];
|
||||
[d1 setObject:o2 forKey:o2];
|
||||
[d1 setObject:o3 forKey:o3];
|
||||
|
||||
|
||||
d2 = [[NSMutableDictionary new] autorelease];
|
||||
[d2 setObject:o4 forKey:o4];
|
||||
[d2 setObject:o5 forKey:o5];
|
||||
|
@ -69,12 +69,12 @@ main(int argc, char** argv, char** envp)
|
|||
|
||||
printf("NSDictionary has count %d\n", [a count]);
|
||||
key = @"fish";
|
||||
printf("Object at key %s is %s\n",
|
||||
printf("Object at key %s is %s\n",
|
||||
[key cString],
|
||||
[[a objectForKey:key] cString]);
|
||||
|
||||
assert([a count] == [[a allValues] count]);
|
||||
|
||||
|
||||
enumerator = [a objectEnumerator];
|
||||
while ((b = [enumerator nextObject]))
|
||||
printf("%s ", [b cString]);
|
||||
|
@ -104,7 +104,7 @@ main(int argc, char** argv, char** envp)
|
|||
}
|
||||
printf(" 10 creation: %f\n", [[NSDate date] timeIntervalSinceDate: when]);
|
||||
printf("%s\n", [[[dict allKeys] description] cString]);
|
||||
|
||||
|
||||
when = [NSDate date];
|
||||
for (i = 0; i < 100000; i++) {
|
||||
for (j = 0; j < 10; j++) {
|
||||
|
@ -124,7 +124,7 @@ printf("%s\n", [[[dict allKeys] description] cString]);
|
|||
[dict setObject: strs[i] forKey: strs[i]];
|
||||
}
|
||||
printf(" 100 creation: %f\n", [[NSDate date] timeIntervalSinceDate: when]);
|
||||
|
||||
|
||||
when = [NSDate date];
|
||||
for (i = 0; i < 10000; i++) {
|
||||
for (j = 0; j < 100; j++) {
|
||||
|
@ -144,7 +144,7 @@ printf("%s\n", [[[dict allKeys] description] cString]);
|
|||
[dict setObject: strs[i] forKey: strs[i]];
|
||||
}
|
||||
printf(" 1000 creation: %f\n", [[NSDate date] timeIntervalSinceDate: when]);
|
||||
|
||||
|
||||
when = [NSDate date];
|
||||
for (i = 0; i < 1000; i++) {
|
||||
for (j = 0; j < 1000; j++) {
|
||||
|
@ -164,7 +164,7 @@ printf("%s\n", [[[dict allKeys] description] cString]);
|
|||
[dict setObject: strs[i] forKey: strs[i]];
|
||||
}
|
||||
printf(" 10000 creation: %f\n", [[NSDate date] timeIntervalSinceDate: when]);
|
||||
|
||||
|
||||
when = [NSDate date];
|
||||
for (i = 0; i < 100; i++) {
|
||||
for (j = 0; j < 10000; j++) {
|
||||
|
@ -184,7 +184,7 @@ printf("%s\n", [[[dict allKeys] description] cString]);
|
|||
[dict setObject: strs[i] forKey: strs[i]];
|
||||
}
|
||||
printf("100000 creation: %f\n", [[NSDate date] timeIntervalSinceDate: when]);
|
||||
|
||||
|
||||
when = [NSDate date];
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (j = 0; j < 100000; j++) {
|
||||
|
|
|
@ -66,7 +66,7 @@ main ()
|
|||
NSLog(@"Remove %@ failed", src);
|
||||
errors++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
RELEASE(arp);
|
||||
|
|
|
@ -36,8 +36,8 @@ int main ()
|
|||
0);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
NSHashInsert (mt,
|
||||
[NSNumber numberWithInt: i],
|
||||
NSHashInsert (mt,
|
||||
[NSNumber numberWithInt: i],
|
||||
[NSNumber numberWithInt: i*i]);
|
||||
|
||||
o = [NSNumber numberWithInt: 3];
|
||||
|
|
|
@ -16,19 +16,19 @@ main ()
|
|||
|
||||
printf("Empty set count is 0 ...");
|
||||
printf(" %s\n", [s count] == 0 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Empty set does not contain index 0 ...");
|
||||
printf(" %s\n", [s containsIndex: 0] == NO ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Empty set does not intersect indexes in range 0->NSNotFound-1 ...");
|
||||
printf(" %s\n", [s intersectsIndexesInRange: NSMakeRange(0,NSNotFound-1)] == NO ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Empty set first index is NSNotFound...");
|
||||
printf(" %s\n", [s firstIndex] == NSNotFound ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Empty set last index is NSNotFound...");
|
||||
printf(" %s\n", [s lastIndex] == NSNotFound ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Empty set index less than 1 is NSNotFound...");
|
||||
printf(" %s\n", [s indexLessThanIndex: 1] == NSNotFound ? "passed" : "failed");
|
||||
printf("Empty set index less than or equal to 1 is NSNotFound...");
|
||||
|
@ -37,7 +37,7 @@ main ()
|
|||
printf(" %s\n", [s indexGreaterThanIndex: 1] == NSNotFound ? "passed" : "failed");
|
||||
printf("Empty set index greater than or equal to 1 is NSNotFound...");
|
||||
printf(" %s\n", [s indexGreaterThanOrEqualToIndex: 1] == NSNotFound ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Empty set getIndexes gives 0...");
|
||||
r = NSMakeRange(0, NSNotFound-1);
|
||||
printf(" %s\n", [s getIndexes: buf maxCount:3 inIndexRange: &r] == 0 ? "passed" : "failed");
|
||||
|
@ -52,19 +52,19 @@ main ()
|
|||
|
||||
printf("Set does not contain index 0 ...");
|
||||
printf(" %s\n", [s containsIndex: 0] == NO ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set contains index 2 ...");
|
||||
printf(" %s\n", [s containsIndex: 2] == YES ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set intersects indexes in range 0->NSNotFound-1 ...");
|
||||
printf(" %s\n", [s intersectsIndexesInRange: NSMakeRange(0,NSNotFound-1)] == YES ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set first index is 2...");
|
||||
printf(" %s\n", [s firstIndex] == 2 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set last index is 2...");
|
||||
printf(" %s\n", [s lastIndex] == 2 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set index less than 1 is NSNotFound...");
|
||||
printf(" %s\n", [s indexLessThanIndex: 1] == NSNotFound ? "passed" : "failed");
|
||||
printf("Set index less than or equal to 1 is NSNotFound...");
|
||||
|
@ -81,7 +81,7 @@ main ()
|
|||
printf(" %s\n", [s indexGreaterThanIndex: 2] == NSNotFound ? "passed" : "failed");
|
||||
printf("Set index greater than or equal to 2 is 2...");
|
||||
printf(" %s\n", [s indexGreaterThanOrEqualToIndex: 2] == 2 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set getIndexes gives 1...");
|
||||
r = NSMakeRange(0, NSNotFound-1);
|
||||
printf(" %s\n", [s getIndexes: buf maxCount:3 inIndexRange: &r] == 1 ? "passed" : "failed");
|
||||
|
@ -96,22 +96,22 @@ main ()
|
|||
|
||||
printf("Set does not contain index 0 ...");
|
||||
printf(" %s\n", [s containsIndex: 0] == NO ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set contains index 2 ...");
|
||||
printf(" %s\n", [s containsIndex: 2] == YES ? "passed" : "failed");
|
||||
|
||||
printf("Set contains index 5 ...");
|
||||
printf(" %s\n", [s containsIndex: 5] == YES ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set intersects indexes in range 0->NSNotFound-1 ...");
|
||||
printf(" %s\n", [s intersectsIndexesInRange: NSMakeRange(0,NSNotFound-1)] == YES ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set first index is 2...");
|
||||
printf(" %s\n", [s firstIndex] == 2 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set last index is 5...");
|
||||
printf(" %s\n", [s lastIndex] == 5 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set index less than 1 is NSNotFound...");
|
||||
printf(" %s\n", [s indexLessThanIndex: 1] == NSNotFound ? "passed" : "failed");
|
||||
printf("Set index less than or equal to 1 is NSNotFound...");
|
||||
|
@ -128,7 +128,7 @@ main ()
|
|||
printf(" %s\n", [s indexGreaterThanIndex: 2] == 3 ? "passed" : "failed");
|
||||
printf("Set index greater than or equal to 2 is 2...");
|
||||
printf(" %s\n", [s indexGreaterThanOrEqualToIndex: 2] == 2 ? "passed" : "failed");
|
||||
|
||||
|
||||
printf("Set getIndexes gives 3...");
|
||||
r = NSMakeRange(0, NSNotFound-1);
|
||||
printf(" %s\n", [s getIndexes: buf maxCount:3 inIndexRange: &r] == 3 ? "passed" : "failed");
|
||||
|
|
|
@ -222,7 +222,7 @@ printf("Calling proxy\n");
|
|||
printf("OK\n");
|
||||
else
|
||||
printf("ERROR ... expecting 6 and got %d\n", i);
|
||||
|
||||
|
||||
printf("Testing NS_INVOCATION ... ");
|
||||
inv = NS_INVOCATION([Target class], loopInt: 7);
|
||||
[inv setTarget: t];
|
||||
|
@ -232,7 +232,7 @@ printf("Calling proxy\n");
|
|||
printf("OK\n");
|
||||
else
|
||||
printf("ERROR ... expecting 8 and got %d\n", i);
|
||||
|
||||
|
||||
#define SETUP(X) \
|
||||
sig = [t methodSignatureForSelector: @selector(X)]; \
|
||||
inv = [NSInvocation invocationWithMethodSignature: sig]; \
|
||||
|
|
|
@ -43,8 +43,8 @@ int main ()
|
|||
0);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
NSMapInsert (mt,
|
||||
[NSNumber numberWithInt: i],
|
||||
NSMapInsert (mt,
|
||||
[NSNumber numberWithInt: i],
|
||||
[NSNumber numberWithInt: i*i]);
|
||||
|
||||
o = [NSNumber numberWithInt: 3];
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
|
@ -251,10 +251,10 @@ test_mframe_build_signature(void)
|
|||
|
||||
[pool release];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
This test is useful if the nsmethodsignatureserver is running which
|
||||
was compiled with either a different GNUstep-base version or a different
|
||||
version of gcc. It the server isn't found the test is skipped.
|
||||
|
@ -284,7 +284,7 @@ test_compare_server_signature(void)
|
|||
GSNameFromSelector(@selector(SELNAME)), \
|
||||
lclSig, rmtSig); \
|
||||
}
|
||||
|
||||
|
||||
TEST_SEL(void_void);
|
||||
TEST_SEL(id_void);
|
||||
TEST_SEL(char_void);
|
||||
|
@ -325,7 +325,7 @@ test_compare_server_signature(void)
|
|||
TEST_SEL(void_double:float:);
|
||||
TEST_SEL(largeStruct_id:char:short:int:long:float:double:largeStruct:smallStruct:);
|
||||
TEST_SEL(smallStruct_id:uchar:ushort:uint:ulong:float:double:largeStruct:smallStruct:);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -367,7 +367,7 @@ test_GSSelectorTypesMatch(void)
|
|||
{
|
||||
if (GSSelectorTypesMatch(pairs[i][0], pairs[i][1]) == NO)
|
||||
{
|
||||
NSLog(@"pair %d does not match:\n%s\n%s",
|
||||
NSLog(@"pair %d does not match:\n%s\n%s",
|
||||
i, pairs[i][0], pairs[i][1]);
|
||||
failed = 1;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* The simplest of tests for the NSNotification and NSNotificationCenter
|
||||
classes. These tests should be expanded.
|
||||
classes. These tests should be expanded.
|
||||
|
||||
(The Tcp*Port classes, however, do test the notification mechanism
|
||||
(The Tcp*Port classes, however, do test the notification mechanism
|
||||
further.) */
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
|
@ -92,7 +92,7 @@ NSLog(@"Post to distributed centre");
|
|||
postNotificationName: foo
|
||||
object: nil];
|
||||
|
||||
|
||||
|
||||
NSLog(@"Remove observer from process centre");
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver: observer1
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <Foundation/NSDate.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSProcessInfo *pi = [NSProcessInfo processInfo];
|
||||
|
@ -24,12 +24,12 @@ int main(int argc, char *argv[])
|
|||
enumerator = [[pi arguments] objectEnumerator];
|
||||
while ((aString = [enumerator nextObject]))
|
||||
printf("-->%s\n",[aString cString]);
|
||||
|
||||
|
||||
printf("\nProcess environment\n");
|
||||
printf("%d environment variables(s)\n", [[pi environment] count]);
|
||||
enumerator = [[pi environment] keyEnumerator];
|
||||
while ((aKey = [enumerator nextObject]))
|
||||
printf("++>%s=%s\n",[aKey cString],[[[pi environment]
|
||||
printf("++>%s=%s\n",[aKey cString],[[[pi environment]
|
||||
objectForKey:aKey] cString]);
|
||||
|
||||
[arp release];
|
||||
|
|
|
@ -37,7 +37,7 @@ testFullScan (const char *message, NSString *string, NSScanner *scanner)
|
|||
|
||||
scanLocation = [scanner scanLocation];
|
||||
if (scanLocation != [string length])
|
||||
printf ("%s of `%s' moves scan location to %u.\n", message,
|
||||
printf ("%s of `%s' moves scan location to %u.\n", message,
|
||||
[string cString], scanLocation);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@ int main()
|
|||
id inv;
|
||||
id o;
|
||||
id d;
|
||||
|
||||
inv = [NSInvocation invocationWithMethodSignature:
|
||||
|
||||
inv = [NSInvocation invocationWithMethodSignature:
|
||||
[TestDouble methodSignatureForSelector: @selector(sayCount)]];
|
||||
[inv setSelector: @selector(sayCount)];
|
||||
[inv setTarget: [TestDouble class]];
|
||||
|
|
|
@ -19,7 +19,7 @@ main ()
|
|||
GSPrintf(stdout, @"System time zone\n");
|
||||
system = [NSTimeZone systemTimeZone];
|
||||
GSPrintf(stdout, @" %@\n\n", [system description]);
|
||||
|
||||
|
||||
GSPrintf(stdout, @"Local time zone:\n %@\n\n",
|
||||
[[NSTimeZone localTimeZone] description]);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ main(int argc, char *argv[])
|
|||
{
|
||||
id table;
|
||||
int i, times;
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Usage: table_test filename repeat\n");
|
||||
fprintf(stderr, " filename is a stringtable format file.\n");
|
||||
|
@ -17,9 +17,9 @@ main(int argc, char *argv[])
|
|||
}
|
||||
if (argc == 3)
|
||||
times = atoi(argv[2]);
|
||||
else
|
||||
else
|
||||
times = 1;
|
||||
|
||||
|
||||
table = [[NXStringTable alloc] init];
|
||||
|
||||
for (i=0; i < times; i++) {
|
||||
|
|
|
@ -18,7 +18,7 @@ int main()
|
|||
printf("%f\n", [r randomDouble]);
|
||||
|
||||
rng = [[RNGBerkeley alloc] init];
|
||||
printf("%s chi^2 = %f\n",
|
||||
printf("%s chi^2 = %f\n",
|
||||
[rng name], [Random chiSquareOfRandomGenerator:rng]);
|
||||
[r release];
|
||||
|
||||
|
@ -27,7 +27,7 @@ int main()
|
|||
for (i = 0; i < 50; i++)
|
||||
printf("%ld\n", [r nextRandom]);
|
||||
*/
|
||||
printf("%s chi^2 = %f\n",
|
||||
printf("%s chi^2 = %f\n",
|
||||
[rng name], [Random chiSquareOfRandomGenerator:rng]);
|
||||
[rng release];
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ autorelease_test (int depth)
|
|||
}
|
||||
|
||||
#if 0
|
||||
fprintf (stderr, "totalAutoreleasedObjects %d\n",
|
||||
fprintf (stderr, "totalAutoreleasedObjects %d\n",
|
||||
[NSAutoreleasePool totalAutoreleasedObjects]);
|
||||
#endif
|
||||
autorelease_test (depth-1);
|
||||
|
@ -103,7 +103,7 @@ my_malloc_hook (size_t size)
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
my_free_hook (void *ptr)
|
||||
{
|
||||
__free_hook = old_free_hook;
|
||||
|
|
|
@ -40,7 +40,7 @@ int main()
|
|||
@"http:/www.foobar.org/PageWithAValid.plist"];
|
||||
data = [currentURL resourceDataUsingCache: NO];
|
||||
|
||||
if( data )
|
||||
if ( data )
|
||||
printf(" YES \n");
|
||||
printf(" NO\n");
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ int main()
|
|||
[fo replaceCharactersInRange: [fo rangeOfString: @"xx"] withString: us1];
|
||||
NS_HANDLER
|
||||
printf("Caught exception during string replacement (expected)\n");
|
||||
NS_ENDHANDLER
|
||||
NS_ENDHANDLER
|
||||
|
||||
[f1 appendString: us0];
|
||||
print_string(f1);
|
||||
|
@ -116,7 +116,7 @@ int main()
|
|||
printf("%x\n", [ext characterAtIndex: i]);
|
||||
for (i = 0; i < 9; i++)
|
||||
printf("%x,%x\n", [base characterAtIndex: i], [want characterAtIndex: i]);
|
||||
|
||||
|
||||
printf("%u\n", [want isEqual: base]);
|
||||
for (i = 0; i < 1000; i++)
|
||||
[base appendString: want];
|
||||
|
|
|
@ -22,7 +22,7 @@ int main (int argc, char *argv[])
|
|||
int i;
|
||||
|
||||
if (argc > 1)
|
||||
out_port = [TcpOutPort newForSendingToRegisteredName:
|
||||
out_port = [TcpOutPort newForSendingToRegisteredName:
|
||||
[NSString stringWithCString: argv[1]]
|
||||
onHost: @"localhost"];
|
||||
else
|
||||
|
@ -38,7 +38,7 @@ int main (int argc, char *argv[])
|
|||
|
||||
[[NSRunLoop currentRunLoop] addPort: in_port
|
||||
forMode: NSDefaultRunLoopMode];
|
||||
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
packet = [[TcpOutPacket alloc] initForSendingWithCapacity: 100
|
||||
|
|
|
@ -51,7 +51,7 @@ id handle_incoming_packet (TcpInPacket *packet)
|
|||
|
||||
packet = [[TcpOutPacket alloc] initForSendingWithCapacity: 100
|
||||
replyInPort: port];
|
||||
[packet writeFormat: @"Your's was my message number %d",
|
||||
[packet writeFormat: @"Your's was my message number %d",
|
||||
message_count];
|
||||
[reply_port sendPacket: packet timeout:10.0];
|
||||
[packet release];
|
||||
|
@ -105,7 +105,7 @@ int main (int argc, char *argv[])
|
|||
|
||||
packet = [[TcpPacket alloc] initForSendingWithCapacity: 100
|
||||
replyPort: port];
|
||||
[packet writeFormat: @"Your's was my message number %d",
|
||||
[packet writeFormat: @"Your's was my message number %d",
|
||||
message_count];
|
||||
[reply_port sendPacket: packet timeout: 20.0];
|
||||
[packet release];
|
||||
|
|
|
@ -38,7 +38,7 @@ FILE *file;
|
|||
{
|
||||
int i, n;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
||||
|
||||
NS_DURING
|
||||
n = 1+(int)((MAX_ITER*rand())/(RAND_MAX+1.0));
|
||||
fflush(stdout);
|
||||
|
@ -76,7 +76,7 @@ int main()
|
|||
for (i = 0; i < N; i++)
|
||||
[NSThread detachNewThreadSelector: @selector(runWith:)
|
||||
toTarget: threads[i] withObject: nil];
|
||||
|
||||
|
||||
// Hopefully this will end after all the other threads end.
|
||||
for (i = 0; i < N*MAX_ITER; i++)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ NSLock *lock = nil;
|
|||
int main(int argc, char **argv, char **env)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
|
||||
|
||||
NSLog(@"Start in main");
|
||||
lock = [NSLock new];
|
||||
[lock lock];
|
||||
|
@ -60,7 +60,7 @@ int main(int argc, char **argv, char **env)
|
|||
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:
|
||||
[NSDate dateWithTimeIntervalSinceNow: 10.0]];
|
||||
|
||||
|
||||
NSLog(@"Done main thread");
|
||||
|
||||
DESTROY(arp);
|
||||
|
|
|
@ -49,17 +49,17 @@ printf("nc compare: ns is %d\n", [nc compare: ns]);
|
|||
if (strcmp([[n7 description] cString], "25") != 0)
|
||||
printf("*** TEST FAILED **** description for short number\n");
|
||||
|
||||
printf("Number(n1) as int %d, as float %f\n",
|
||||
printf("Number(n1) as int %d, as float %f\n",
|
||||
[n1 intValue], [n1 floatValue]);
|
||||
printf("n1 times n2=%f as int to get %d\n",
|
||||
printf("n1 times n2=%f as int to get %d\n",
|
||||
[n2 floatValue], [n1 intValue]*[n2 intValue]);
|
||||
printf("n2 as string: %s\n", [[n2 stringValue] cString]);
|
||||
printf("n2 compare: n1 is %d\n", [n2 compare: n1]);
|
||||
printf("n1 compare: n2 is %d\n", [n1 compare: n2]);
|
||||
printf("n1 isEqual: n3 is %d\n", [n1 isEqual: n3]);
|
||||
printf("n4 isEqual: n5 is %d\n", [n4 isEqual: n5]);
|
||||
printf("n4 isEqual: n5 is %d\n", [n4 isEqual: n5]);
|
||||
|
||||
a1 = [NSMutableArray arrayWithObjects:
|
||||
a1 = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithChar: 111],
|
||||
[NSNumber numberWithUnsignedChar: 112],
|
||||
[NSNumber numberWithShort: 121],
|
||||
|
@ -71,7 +71,7 @@ printf("nc compare: ns is %d\n", [nc compare: ns]);
|
|||
[NSNumber numberWithFloat: 151],
|
||||
[NSNumber numberWithDouble: 152], nil];
|
||||
|
||||
a2 = [NSMutableArray arrayWithObjects:
|
||||
a2 = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithChar: 111],
|
||||
[NSNumber numberWithUnsignedChar: 112],
|
||||
[NSNumber numberWithShort: 121],
|
||||
|
@ -83,7 +83,7 @@ printf("nc compare: ns is %d\n", [nc compare: ns]);
|
|||
[NSNumber numberWithFloat: 151],
|
||||
[NSNumber numberWithDouble: 152], nil];
|
||||
|
||||
printf("a1 isEqual: a2 is %d\n", [a1 isEqual: a2]);
|
||||
printf("a1 isEqual: a2 is %d\n", [a1 isEqual: a2]);
|
||||
|
||||
// Test values, Geometry
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ printf("nc compare: ns is %d\n", [nc compare: ns]);
|
|||
a2 = [NSUnarchiver unarchiveObjectWithData:
|
||||
[NSArchiver archivedDataWithRootObject: a1]];
|
||||
|
||||
printf("After archiving, a1 isEqual: a2 is %d\n", [a1 isEqual: a2]);
|
||||
printf("After archiving, a1 isEqual: a2 is %d\n", [a1 isEqual: a2]);
|
||||
if ([a1 isEqual: a2] == NO)
|
||||
{
|
||||
printf("a1 - %s\n", [[a1 description] cString]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue