DELETED tests/OFAutoreleasePool/Makefile Index: tests/OFAutoreleasePool/Makefile ================================================================== --- tests/OFAutoreleasePool/Makefile +++ tests/OFAutoreleasePool/Makefile @@ -1,25 +0,0 @@ -PROG_NOINST = ofautoreleasepool${PROG_SUFFIX} -SRCS = OFAutoreleasePool.m - -include ../../buildsys.mk -include ../../extra.mk - -CPPFLAGS += -I../../src -I../.. -LIBS := -L../../src -lobjfw ${LIBS} - -.PHONY: run - -all: run -run: ${PROG_NOINST} - rm -f libobjfw.so.0 libobjfw.so.0.1 libobjfw.dll libobjfw.dylib - ln -s ../../src/libobjfw.so libobjfw.so.0 - ln -s ../../src/libobjfw.so libobjfw.so.0.1 - if test -f ../../src/libobjfw.dll; then \ - ln ../../src/libobjfw.dll libobjfw.dll; \ - fi - ln -s ../../src/libobjfw.dylib libobjfw.dylib - LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ - DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ - ${TEST_LAUNCHER} ./${PROG_NOINST}; EXIT=$$?; \ - rm -f libobjfw.so.0 libobjfw.so.0.1 libobjfw.dll libobjfw.dylib; \ - exit $$EXIT DELETED tests/OFAutoreleasePool/OFAutoreleasePool.m Index: tests/OFAutoreleasePool/OFAutoreleasePool.m ================================================================== --- tests/OFAutoreleasePool/OFAutoreleasePool.m +++ tests/OFAutoreleasePool/OFAutoreleasePool.m @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2008 - 2009 - * Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of libobjfw. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE included in - * the packaging of this file. - */ - -#include "config.h" - -#include - -#import "OFAutoreleasePool.h" - -#ifndef _WIN32 -#define ZD "%zd" -#else -#define ZD "%u" -#endif - -int inits; -int retains; -int releases; - -IMP init; -IMP retain; -IMP release; - -@interface TestObject: OFObject -- init; -- retain; -- (void)release; -@end - -@implementation TestObject -- init -{ - id ret; - - inits++; - - ret = init(self, _cmd); - printf("New %s with retain cnt " ZD "\n", [self className], - [ret retainCount]); - - return ret; -} - -- retain -{ - id ret; - - retains++; - - ret = retain(self, _cmd); - printf("Retaining %s to " ZD "\n", [self className], [ret retainCount]); - - return ret; -} - -- (void)release -{ - releases++; - - printf("Releasing %s to " ZD "\n", [self className], - [self retainCount] - 1); - release(self, _cmd); -} -@end - -int -main() -{ - inits = retains = releases = 0; - - init = [OFObject replaceMethod: @selector(init) - withMethodFromClass: [TestObject class]]; - retain = [OFObject replaceMethod: @selector(retain) - withMethodFromClass: [TestObject class]]; - release = [OFObject replaceMethod: @selector(release) - withMethodFromClass: [TestObject class]]; - - OFObject *o1, *o2, *o3; - OFAutoreleasePool *pool1, *pool2; - - o1 = [[[OFObject alloc] init] autorelease]; - - pool1 = [[OFAutoreleasePool alloc] init]; - o2 = [[[OFObject alloc] init] autorelease]; - [pool1 releaseObjects]; - - o2 = [[[OFObject alloc] init] autorelease]; - - pool2 = [[OFAutoreleasePool alloc] init]; - o3 = [[[OFObject alloc] init] autorelease]; - - [pool1 release]; - - printf("inits: %02d\nretains: %02d\nreleases: %02d\n", - inits, retains, releases); - return (inits == 17 && retains == 5 && releases == 16 ? 0 : 1); -}