Skip to content

Commit

Permalink
fix non-portable testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Jul 16, 2024
1 parent b677ea4 commit d32065b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Tests/base/NSXMLElement/attributes.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit d32065b

Please sign in to comment.