mirror of
https://github.com/darlinghq/darling-objc4.git
synced 2024-11-23 04:09:46 +00:00
29 lines
916 B
Objective-C
29 lines
916 B
Objective-C
// TEST_CONFIG
|
|
|
|
#include "test.h"
|
|
#include "testroot.i"
|
|
|
|
#include <dlfcn.h>
|
|
|
|
extern uintptr_t objc_debug_realized_class_generation_count;
|
|
|
|
int main()
|
|
{
|
|
testassert(objc_debug_realized_class_generation_count > 0);
|
|
uintptr_t prev = objc_debug_realized_class_generation_count;
|
|
|
|
void *handle = dlopen("/System/Library/Frameworks/Foundation.framework/Foundation", RTLD_LAZY);
|
|
testassert(handle);
|
|
Class c = objc_getClass("NSFileManager");
|
|
testassert(c);
|
|
testassert(objc_debug_realized_class_generation_count > prev);
|
|
|
|
prev = objc_debug_realized_class_generation_count;
|
|
c = objc_allocateClassPair([TestRoot class], "Dynamic", 0);
|
|
testassert(objc_debug_realized_class_generation_count > prev);
|
|
prev = objc_debug_realized_class_generation_count;
|
|
objc_registerClassPair(c);
|
|
testassert(objc_debug_realized_class_generation_count == prev);
|
|
|
|
succeed(__FILE__);
|
|
} |