Differences From Artifact [1f6282da2f]:
- File
src/test/OTAppDelegate.m
— part of check-in
[f5b4f0fa39]
at
2024-02-10 14:00:38
on branch trunk
— ObjFWTest: Don't rely on +[isSubclassOfClass:]
Not all classes returned by objc_copyClassList() might have this method.
This fixes crashing when using the Apple runtime (which presumably has
some internal classes without said method). (user: js, size: 4130) [annotate] [blame] [check-ins using] [more...]
To Artifact [94d0e3c3f7]:
- File
src/test/OTAppDelegate.m
— part of check-in
[f4bb3f5a76]
at
2024-02-10 14:16:02
on branch trunk
— ObjFWTest: Make sure classes are initialized
This fixes it with the ObjFW runtime again, which was broken by the last
change that as a side effect no longer initialized classes. However,
before class_getSuperclass() can be called in the ObjFW runtime, the
class needs to be initialized. (user: js, size: 4472) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
46 47 48 49 50 51 52 | if (classes == NULL) return nil; @try { testClasses = [OFMutableSet set]; | | > > > > > > > > > > > > > | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | if (classes == NULL) return nil; @try { testClasses = [OFMutableSet set]; for (Class *iter = classes; *iter != Nil; iter++) { /* * Make sure the class is initialized. * Required for the ObjFW runtime, as otherwise * class_getSuperclass() crashes. */ [*iter class]; /* * Don't use +[isSubclassOfClass:], as the Apple runtime * can return (presumably internal?) classes that don't * implement it, resulting in a crash. */ if (isSubclassOfClass(*iter, [OTTestCase class])) [testClasses addObject: *iter]; } } @finally { OFFreeMemory(classes); } [testClasses removeObject: [OTTestCase class]]; [testClasses makeImmutable]; |
︙ | ︙ |