mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
* Tests/base/NSArchiver/stringEncoding.m: Use PASS_EQUAL instead
of PASS. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36617 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
360e1f6ec6
commit
276d411340
4 changed files with 35 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-05-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Tests/base/NSArchiver/stringEncoding.m: Use PASS_EQUAL instead
|
||||
of PASS.
|
||||
|
||||
2013-05-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/ObjectiveC2/runtime.c: when replacing a method, update the
|
||||
|
|
|
@ -407,6 +407,7 @@ extern "C" {
|
|||
@interface NSKeyedUnarchiver (Internal)
|
||||
- (id) _decodeArrayOfObjectsForKey: (NSString*)aKey;
|
||||
- (id) _decodePropertyListForKey: (NSString*)aKey;
|
||||
- (BOOL) replaceObject: (id)oldObj withObject: (id)newObj;
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -139,6 +139,31 @@ static NSMapTable *globalClassMap = 0;
|
|||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method is used to replace oldObj with newObj
|
||||
* in the map that is maintained in NSKeyedUnarchiver.
|
||||
*/
|
||||
- (BOOL) replaceObject: (id)oldObj withObject: (id)newObj
|
||||
{
|
||||
unsigned int i = 0;
|
||||
unsigned int count = GSIArrayCount(_objMap);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
id obj = GSIArrayItemAtIndex(_objMap, i).obj;
|
||||
if (obj == oldObj)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)newObj, i);
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSKeyedUnarchiver (Private)
|
||||
|
|
|
@ -13,22 +13,22 @@ int main(int argc, const char **argv)
|
|||
{
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject: EszettStr];
|
||||
NSString *unarchivedString = [NSKeyedUnarchiver unarchiveObjectWithData: data];
|
||||
|
||||
PASS([unarchivedString isEqual: EszettStr],
|
||||
|
||||
PASS_EQUAL(unarchivedString, EszettStr,
|
||||
"'eszett' character roundtrip to binary plist seems to work.");
|
||||
}
|
||||
|
||||
{
|
||||
NSString *plist1String = [NSKeyedUnarchiver unarchiveObjectWithFile: @"eszett1.plist"];
|
||||
|
||||
PASS([plist1String isEqual: EszettStr],
|
||||
PASS_EQUAL(plist1String, EszettStr,
|
||||
"'eszett' character read from OSX binary plist");
|
||||
}
|
||||
|
||||
{
|
||||
NSString *plist2String = [NSKeyedUnarchiver unarchiveObjectWithFile: @"eszett2.plist"];
|
||||
|
||||
PASS([plist2String isEqual: EszettStr],
|
||||
PASS_EQUAL(plist2String, EszettStr,
|
||||
"'eszett' character read from GNUstep binary plist");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue