6 @implementation TestRoot (Loader)
9 [[TestRoot new] autorelease];
10 testassert(TestRootAutorelease == 1);
11 testassert(TestRootDealloc == 0);
17 // +load's autoreleased object should have deallocated
18 testassert(TestRootDealloc == 1);
20 [[TestRoot new] autorelease];
21 testassert(TestRootAutorelease == 2);
24 objc_autoreleasePoolPop(objc_autoreleasePoolPush());
25 [[TestRoot new] autorelease];
26 testassert(TestRootAutorelease == 3);
30 [[TestRoot new] autorelease];
31 testassert(TestRootAutorelease == 4);
32 testassert(TestRootDealloc == 1);
34 // thread's autoreleased object should have deallocated
35 testassert(TestRootDealloc == 2);
38 // Test no-pool autorelease after a pool was pushed and popped.
39 // The simplest POOL_SENTINEL check during pop gets this wrong.
41 objc_autoreleasePoolPop(objc_autoreleasePoolPush());
42 [[TestRoot new] autorelease];
43 testassert(TestRootAutorelease == 5);
44 testassert(TestRootDealloc == 2);
46 testassert(TestRootDealloc == 3