mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Fix bug #43915 (equality not checked correctly for NSCountedSet)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38470 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
681ab5aa23
commit
9f352f0cdf
5 changed files with 68 additions and 3 deletions
21
Tests/base/NSCountedSet/equality.m
Normal file
21
Tests/base/NSCountedSet/equality.m
Normal file
|
@ -0,0 +1,21 @@
|
|||
#import "ObjectTesting.h"
|
||||
#import <Foundation/NSSet.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSCountedSet *count1 = [NSCountedSet setWithObjects: @"1", @"1", nil];
|
||||
NSCountedSet *count2 = [NSCountedSet setWithObjects: @"1", @"1", nil];
|
||||
NSCountedSet *count3 = [NSCountedSet setWithObjects: @"1", nil];
|
||||
NSSet *set = [NSSet setWithObjects: @"1", nil];
|
||||
PASS([count1 isEqualToSet: count2], "Identical counted sets are equal");
|
||||
PASS(![count1 isEqualToSet: count3], "Different counted sets are not equal");
|
||||
PASS([count3 isEqualToSet: set], "Counted set is equal to plain set");
|
||||
PASS([set isEqualToSet: count3], "Plain set is equal to counted set");
|
||||
PASS(![count1 isEqualToSet: set], "Counted set with different counts is not equal to plain set");
|
||||
PASS(![set isEqualToSet: count1], "Plain set is not equal to counted set with different counts");
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue