ObjFW  Diff

Differences From Artifact [6e0282335c]:

  • File new_tests/RuntimeTests.m — part of check-in [2ffd3b79f9] at 2024-02-17 19:35:53 on branch objfwtest — Migrate RuntimeTests to ObjFWTest (user: js size: 3683)
  • File tests/RuntimeTests.m — part of check-in [7a84580fb6] at 2024-02-18 19:29:26 on branch objfwtest — Rename new tests (user: js size: 3683)

To Artifact [358d865eaa]:

  • File tests/RuntimeTests.m — part of check-in [c3e83facc5] at 2024-02-24 19:40:41 on branch trunk — Make everything work on macOS Leopard again (user: js size: 3762)

82
83
84
85
86
87
88

89
90
91
92
93
94
95
	OFMutableString *string = [OFMutableString stringWithString: @"foo"];

	_test.bar = string;
	OTAssertEqual(_test.bar, string);
	OTAssertEqual(string.retainCount, 3);
}


- (void)testAssociatedObjects
{
	objc_setAssociatedObject(self, testKey, _test, OBJC_ASSOCIATION_ASSIGN);
	OTAssertEqual(_test.retainCount, 1);

	objc_setAssociatedObject(self, testKey, _test, OBJC_ASSOCIATION_RETAIN);
	OTAssertEqual(_test.retainCount, 2);







>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
	OFMutableString *string = [OFMutableString stringWithString: @"foo"];

	_test.bar = string;
	OTAssertEqual(_test.bar, string);
	OTAssertEqual(string.retainCount, 3);
}

#if defined(OF_OBJFW_RUNTIME) || defined(HAVE_OBJC_SETASSOCIATEDOBJECT)
- (void)testAssociatedObjects
{
	objc_setAssociatedObject(self, testKey, _test, OBJC_ASSOCIATION_ASSIGN);
	OTAssertEqual(_test.retainCount, 1);

	objc_setAssociatedObject(self, testKey, _test, OBJC_ASSOCIATION_RETAIN);
	OTAssertEqual(_test.retainCount, 2);
106
107
108
109
110
111
112

113
114
115
116
117
118
119

	OTAssertEqual(objc_getAssociatedObject(self, testKey), _test);
	OTAssertEqual(_test.retainCount, 3);

	objc_removeAssociatedObjects(self);
	OTAssertEqual(_test.retainCount, 2);
}


#ifdef OF_OBJFW_RUNTIME
- (void)testTaggedPointers
{
	int classID;
	uintmax_t value;
	id object;







>







107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

	OTAssertEqual(objc_getAssociatedObject(self, testKey), _test);
	OTAssertEqual(_test.retainCount, 3);

	objc_removeAssociatedObjects(self);
	OTAssertEqual(_test.retainCount, 2);
}
#endif

#ifdef OF_OBJFW_RUNTIME
- (void)testTaggedPointers
{
	int classID;
	uintmax_t value;
	id object;