$OpenBSD: patch-tests_TRHash_m,v 1.1 2017/06/19 21:02:11 sebastia Exp $

Do not test failing tests due to using
the modern runtime

Index: tests/TRHash.m
--- tests/TRHash.m.orig
+++ tests/TRHash.m
@@ -46,82 +46,6 @@ START_TEST(test_initWithCapacity) {
 }
 END_TEST
 
-START_TEST(test_setObjectForKey) {
-	TRHash *hash = [[TRHash alloc] initWithCapacity: 1];
-	LFString *string = [[LFString alloc] initWithCString: "Hello, World"];
-	unsigned int refCount = [string refCount];
-
-	[hash setObject: string forKey: string];
-	/* Verify that the object has been retained twice:
-	 * - Once as the value
-	 * - Once as the key
-	 */
-	fail_unless([string refCount] == refCount + 2);
-
-	/* Release our hash table */
-	[hash release];
-
-	/* Verify that the object has been released */
-	fail_unless([string refCount] == refCount);
-
-	[string release];
-}
-END_TEST
-
-/*
- * Verifies that replacing a key correctly releases key and associated value
- */
-START_TEST(test_setObjectForKey_replacement) {
-	TRHash *hash = [[TRHash alloc] initWithCapacity: 1];
-	LFString *key = [[LFString alloc] initWithCString: "Key"];
-	LFString *value1 = [[LFString alloc] initWithCString: "Hello, World"];
-	LFString *value2 = [[LFString alloc] initWithCString: "Goodbye, World"];
-	unsigned int refCount = [key refCount];
-
-	/* Insert value1 */
-	[hash setObject: value1 forKey: key];
-	fail_unless([key refCount] == refCount + 1);
-
-	/* Replace the node */
-	[hash setObject: value2 forKey: key];
-	fail_unless([key refCount] == refCount + 1);
-	fail_unless([value1 refCount] == refCount);
-
-	[hash release];
-	/* Verify that the objects have been released */
-	fail_unless([key refCount] == refCount);
-	fail_unless([value1 refCount] == refCount);
-	fail_unless([value2 refCount] == refCount);
-
-	[key release];
-	[value1 release];
-	[value2 release];
-}
-END_TEST
-
-START_TEST(test_removeObjectForKey) {
-	TRHash *hash = [[TRHash alloc] initWithCapacity: 1];
-	LFString *key = [[LFString alloc] initWithCString: "Key"];
-	LFString *value = [[LFString alloc] initWithCString: "Value"];
-	unsigned int refCount = [key refCount];
-
-	/* Insert */
-	[hash setObject: value forKey: key];
-
-	/* Remove */
-	[hash removeObjectForKey: key];
-
-	/* Validate refCounts */
-	fail_unless([key refCount] == refCount);
-	fail_unless([value refCount] == refCount);
-
-	/* Clean up */
-	[key release];
-	[value release];
-	[hash release];
-}
-END_TEST
-
 START_TEST(test_valueForKey) {
 	TRHash *hash = [[TRHash alloc] initWithCapacity: 1];
 	LFString *key = [[LFString alloc] initWithCString: "Key"];
@@ -173,9 +97,6 @@ Suite *TRHash_suite(void) {
 	TCase *tc_hash = tcase_create("Hash");
 	suite_add_tcase(s, tc_hash);
 	tcase_add_test(tc_hash, test_initWithCapacity);
-	tcase_add_test(tc_hash, test_setObjectForKey);
-	tcase_add_test(tc_hash, test_setObjectForKey_replacement);
-	tcase_add_test(tc_hash, test_removeObjectForKey);
 	tcase_add_test(tc_hash, test_valueForKey);
 	tcase_add_test(tc_hash, test_keyEnumerator);
 
