libs-base/Testing/basic.m
CaS 6fbf6d25ab Minor fix for zombies and new tool added.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13363 72102866-910b-0410-8b05-ffd578937521
2002-04-05 16:26:47 +00:00

38 lines
916 B
Objective-C

#include <Foundation/Foundation.h>
#include <stdio.h>
#if 1
int main ()
{
id pool = [NSAutoreleasePool new];
id o = [NSObject new];
NSArray *a = [NSArray arrayWithObjects: @"a", @"b", nil];
printf ("Hello from object at 0x%x\n", (unsigned)[o self]);
NSLog(@"Value for foo is %@", [a valueForKey: @"foo"]);
[o release];
o = [NSString stringWithFormat: @"/proc/%d/status", getpid()];
NSLog(@"'%@'", o);
o = [NSString stringWithContentsOfFile: o];
NSLog(@"'%@'", o);
exit (0);
}
#else
int main (int argc, char **argv)
{
NSString *string;
id pool = [NSAutoreleasePool new];
NSProcessInfo *info = [NSProcessInfo processInfo];
NSUserDefaults *defaults;
NSLog(@"Temporary directory - %@", NSTemporaryDirectory());
[info setProcessName: @"TestProcess"];
defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"%@", [defaults dictionaryRepresentation]);
return 0;
}
#endif