ObjFW  Check-in [7b21071996]

Overview
Comment:Fix and enable -[OFDictionaryTests testHash]

The hash was stable after all, the problem was that everything gets
XOR'd together and thus a dictionary with the objects for keys and keys
for objects has the same hash.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | objfwtest
Files: files | file ages | folders
SHA3-256: 7b210719964dbe1fb5fb266e7a212e72e0ef43ac48c86c1eaf07efe0950f0813
User & Date: js on 2024-02-18 12:49:08
Other Links: branch diff | manifest | tags
Context
2024-02-18
12:51
Make GCC happy again check-in: 69a0cfcb13 user: js tags: objfwtest
12:49
Fix and enable -[OFDictionaryTests testHash] check-in: 7b21071996 user: js tags: objfwtest
12:34
Migrate OFDictionaryTests to ObjFWTest check-in: 728cc47880 user: js tags: objfwtest
Changes

Modified new_tests/OFDictionaryTests.m from [b592578265] to [9cb3005942].

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
					  count: 2]);
	OTAssertNotEqualObjects(_dictionary,
	    [OFDictionary dictionaryWithObjects: keys
					forKeys: objects
					  count: 2]);
}

/* FIXME: Hash is currently not stable. Enable test as soon as this is fixed. */
#if 0
- (void)testHash
{
	OTAssertEqual(_dictionary.hash,
	    [[OFDictionary dictionaryWithObjects: objects
					 forKeys: keys
					   count: 2] hash]);
	OTAssertNotEqual(_dictionary.hash,
	    [[OFDictionary dictionaryWithObjects: keys
					 forKeys: objects
					   count: 2] hash]);
}
#endif

- (void)testCopy
{
	OTAssertEqualObjects([[_dictionary copy] autorelease], _dictionary);
}

- (void)testValueForKey







<
<







|
<
|

<







73
74
75
76
77
78
79


80
81
82
83
84
85
86
87

88
89

90
91
92
93
94
95
96
					  count: 2]);
	OTAssertNotEqualObjects(_dictionary,
	    [OFDictionary dictionaryWithObjects: keys
					forKeys: objects
					  count: 2]);
}



- (void)testHash
{
	OTAssertEqual(_dictionary.hash,
	    [[OFDictionary dictionaryWithObjects: objects
					 forKeys: keys
					   count: 2] hash]);
	OTAssertNotEqual(_dictionary.hash,
	    [[OFDictionary dictionaryWithObject: objects[0]

					 forKey: keys[0]] hash]);
}


- (void)testCopy
{
	OTAssertEqualObjects([[_dictionary copy] autorelease], _dictionary);
}

- (void)testValueForKey