Merge pull request #255 from gnustep/coding-msvc-test-fixes

NSArchiver Unit Test Fixes (Size of BOOL) on Windows MSVC
This commit is contained in:
Hugo Melder 2022-08-04 16:58:34 +02:00 committed by GitHub
commit 8e0dc2ace6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 17 additions and 11 deletions

3
.gitignore vendored
View file

@ -10,6 +10,7 @@ Tests/base/*/GNUmakefile
*.sum
# Test products
Tests/base/coding/*.type
Tests/base/NSBundle/Resources/TestBundle.bundle/
Tests/base/NSBundle/Resources/TestFramework.framework/
Tests/base/NSBundle/Resources/derived_src/
@ -67,4 +68,4 @@ DerivedData/
### Xcode Patch ###
**/xcshareddata/WorkspaceSettings.xcsettings
# End of https://www.gitignore.io/api/xcode
# End of https://www.gitignore.io/api/xcode

View file

@ -1,3 +1,10 @@
2022-08-04 Hugo Melder <contact@hugomelder.com>
* Tests/base/coding/basictypes.m:
Fetch the generated .type file directly to avoid size mismatches.
* .gitignore:
Ignore .type files in the coding unit test directory.
2022-07-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m:

Binary file not shown.

View file

@ -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.