Fix up tests and vsprintf config test

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/freeze-1_6_0@16190 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2003-03-17 17:46:05 +00:00
parent bbc5dcf858
commit 8856af2a9d
9 changed files with 46 additions and 7 deletions

View file

@ -22,7 +22,8 @@ portion of the OpenStep standard (the Foundation library).
There is more information available at the GNUstep homepage
at @samp{http://www.gnustep.org}.
Note that versions that have a odd minor release number are unstable
Note that versions that have a odd minor release number (the second number,
y, in x.y.z) are unstable
releases (like 1.5.2), which even minor release numbers (1.4.1) are stable
releases.

View file

@ -21,7 +21,7 @@
- afterLoad
{
printf("%s's instance variable is %i\n", [self name], var);
printf("%s's instance variable is %i\n", [self description], var);
return self;
}

View file

@ -3,7 +3,6 @@
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSString.h>
#include <Foundation/NSTimeZone.h>
#include <Foundation/GSCategories.h>
#ifdef __MS_WIN32__
int _MB_init_runtime()

View file

@ -1,5 +1,7 @@
#include <Foundation/Foundation.h>
static int errors = 0;
@interface Handler : NSObject
- (BOOL) fileManager: (NSFileManager*)manager
shouldProceedAfterError: (NSString*)error;
@ -12,12 +14,14 @@ willProcessPath: (NSString*)path;
shouldProceedAfterError: (NSString*)error
{
NSLog(@"Error - %@", error);
errors++;
return NO;
}
- (BOOL) fileManager: (NSFileManager*)manager
willProcessPath: (NSString*)path
{
NSLog(@"Processing %@", path);
errors++;
return NO;
}
@end
@ -39,6 +43,7 @@ main ()
if ([mgr copyPath: src toPath: dst handler: handler] == NO)
{
NSLog(@"Copy %@ to %@ failed", src, dst);
errors++;
}
}
@ -48,10 +53,13 @@ main ()
if ([mgr removeFileAtPath: src handler: handler] == NO)
{
NSLog(@"Remove %@ failed", src);
errors++;
}
}
RELEASE(arp);
if (errors == 0)
printf("Tests passed\n");
exit (0);
}

View file

@ -953,5 +953,6 @@ main (int argc, char **argv)
runtest (testScanUpToString);
runtest (testScanCharactersFromSet);
runtest (testScanUpToCharactersFromSet);
printf("Finished Tests\n");
return 0;
}

View file

@ -1,6 +1,7 @@
/* Test time zone code. */
#include <stdio.h>
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSDictionary.h>
@ -10,6 +11,7 @@ int
main ()
{
id detail;
CREATE_AUTORELEASE_POOL(pool);
printf("time zones for PST:\n%s\n",
[[[[NSTimeZone abbreviationMap] objectForKey: @"PST"] description] UTF8String]);
@ -17,5 +19,6 @@ main ()
[[[NSTimeZone timeZoneArray] description] UTF8String]);
printf("local time zone:\n%s\n",
[[[NSTimeZone localTimeZone] description] UTF8String]);
RELEASE(pool);
return 0;
}

View file

@ -138,5 +138,6 @@ main ()
}
#endif
printf("Tests finished\n");
exit (0);
}

View file

@ -1,10 +1,23 @@
/* Exit with status 0 if vasprintf returns the length of the string printed.
Some systems return a pointer to the string instead. */
#include <stdio.h>
#include <stdarg.h>
int main ()
static int func(const char *fmt, ...)
{
va_list ap;
char *buf;
if (vasprintf (&buf, "1234", 0) == 4)
int result;
va_start(ap, fmt);
result = vasprintf(&buf, fmt, ap);
va_end(ap);
return result;
}
int main()
{
if (func("1234", 0) == 4)
exit (0);
exit (-1);
}

View file

@ -1,10 +1,23 @@
/* Exit with status 0 if vsprintf returns the length of the string printed.
Some systems return a pointer to the string instead. */
#include <stdio.h>
#include <stdarg.h>
int main ()
static int func(const char *fmt, ...)
{
va_list ap;
char buf[128];
if (vsprintf (buf, "1234", 0) == 4)
int result;
va_start(ap, fmt);
result = vsprintf(buf, fmt, ap);
va_end(ap);
return result;
}
int main()
{
if (func("1234", 0) == 4)
exit (0);
exit (-1);
}