test_BNLong.m 603 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * This is a test for bnobject
  3. */
  4. #include "si_test.h"
  5. #include "bn/BNObject.h"
  6. @interface TestClass : BNObject
  7. @end
  8. @implementation TestClass
  9. @end
  10. TEST_FUNC(bnobject) {
  11. id obj;
  12. obj = [[TestClass alloc] init];
  13. TEST_NOTNULL(obj);
  14. TEST_NULL([obj free]);
  15. obj = [[TestClass alloc] init];
  16. TEST_INTEQ([obj references], 1);
  17. TEST_PTREQ([obj retain], obj);
  18. TEST_INTEQ([obj references], 2);
  19. TEST_PTREQ([obj release], obj);
  20. TEST_INTEQ([obj references], 1);
  21. TEST_NULL([obj release]);
  22. TEST_DONE();
  23. }
  24. int main(void) {
  25. TEST_INIT();
  26. TEST_RUN(bnobject);
  27. TEST_REPORT();
  28. }