darling-objc4/test/classversion.m
2020-06-09 21:50:17 -04:00

20 lines
415 B
Objective-C

// TEST_CONFIG
#include "test.h"
#include "testroot.i"
#include <objc/runtime.h>
int main()
{
Class cls = [TestRoot class];
testassert(class_getVersion(cls) == 0);
testassert(class_getVersion(object_getClass(cls)) > 5);
class_setVersion(cls, 100);
testassert(class_getVersion(cls) == 100);
testassert(class_getVersion(Nil) == 0);
class_setVersion(Nil, 100);
succeed(__FILE__);
}