fix non-portable testcases

This commit is contained in:
rfm 2024-07-16 13:46:09 +01:00
parent b677ea402a
commit d32065b322

View file

@ -43,15 +43,16 @@ int main()
NSInternalInconsistencyException,
"cannot add attributes to multiple parents");
[root1 setAttributes:@[attr2]];
[root1 setAttributes: [NSArray arrayWithObject: attr2]];
PASS_EQUAL([root1 attributeForName: @"attr2"], attr2,
"setAttributes: added the new attribute");
PASS_EQUAL([root1 attributeForName: @"attr1"], nil,
"setAttributes: removed the old attribute");
PASS_EQUAL([root1 attributes], @[attr2], "attributes are just as set");
[root1 setAttributes:@[]];
PASS_EQUAL([root1 attributes], @[], "setAttributes:@[] removes all attributes");
PASS_EQUAL([root1 attributes], [NSArray arrayWithObject: attr2],
"attributes are just as set");
[root1 setAttributes: [NSArray array]];
PASS_EQUAL([root1 attributes], [NSArray array],
"setAttributes: to an empty array removes all attributes");
[root1 release];
[root2 release];