classversion.m 415 B

12345678910111213141516171819
  1. // TEST_CONFIG
  2. #include "test.h"
  3. #include "testroot.i"
  4. #include <objc/runtime.h>
  5. int main()
  6. {
  7. Class cls = [TestRoot class];
  8. testassert(class_getVersion(cls) == 0);
  9. testassert(class_getVersion(object_getClass(cls)) > 5);
  10. class_setVersion(cls, 100);
  11. testassert(class_getVersion(cls) == 100);
  12. testassert(class_getVersion(Nil) == 0);
  13. class_setVersion(Nil, 100);
  14. succeed(__FILE__);
  15. }