mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 16:20:42 +00:00
Fix coding unit test and tolerate size differences
This commit is contained in:
parent
42efca0754
commit
e6789cb7ed
15 changed files with 8 additions and 10 deletions
Binary file not shown.
BIN
Tests/base/coding/BOOL-4.type
Normal file
BIN
Tests/base/coding/BOOL-4.type
Normal file
Binary file not shown.
|
@ -114,15 +114,10 @@ void testReadBasicType_##testName (char *pre, testType *expect, testType *toDeco
|
|||
NSData *data; \
|
||||
NSUnarchiver *unArch; \
|
||||
NSString *str2; \
|
||||
NSArray *encodedFiles; \
|
||||
NSString *prefix = [[NSString stringWithCString:pre] retain]; \
|
||||
unsigned int i, c; \
|
||||
encodedFiles = [[NSBundle bundleWithPath: [fm currentDirectoryPath]] \
|
||||
pathsForResourcesOfType:@"type" inDirectory:nil]; \
|
||||
for (i = 0, c = [encodedFiles count]; i < c; i++) \
|
||||
{ \
|
||||
NSString *fileName = [encodedFiles objectAtIndex:i]; \
|
||||
if ([[fileName lastPathComponent] hasPrefix:prefix]) \
|
||||
NSString *fileName; \
|
||||
long typeSize = sizeof(testType); \
|
||||
fileName = [[NSString stringWithFormat:@"%s-%li.type",pre,typeSize] retain]; \
|
||||
if ([fm isReadableFileAtPath:fileName]) \
|
||||
{ \
|
||||
data = [NSData dataWithContentsOfFile:fileName]; \
|
||||
unArch = [[NSUnarchiver alloc] initForReadingWithData:data]; \
|
||||
|
@ -136,7 +131,10 @@ void testReadBasicType_##testName (char *pre, testType *expect, testType *toDeco
|
|||
PASS((VAL_TEST(*expect,*toDecode) && [str isEqual:str2]), \
|
||||
"can unarchive %s from %s", pre, [fileName UTF8String]); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
PASS(1 == 2, "Archive %s not found.", [fileName UTF8String]); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define VAL_TEST(testX,testY) testX == testY
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue