Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -169,14 +169,14 @@ ], [ Foo *foo = (id)0; [foo setBar: (id)0]; foo = [foo bar]; ], [ - AC_SUBST(PROPERTIESTESTS_M, "PropertiesTests.m") AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) + AC_MSG_ERROR(Compiler does not support properties!) ]) AC_MSG_CHECKING(whether Objective C compiler supports blocks) old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -fblocks" Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -38,11 +38,10 @@ OFKERNELEVENTOBSERVER_KQUEUE_M = @OFKERNELEVENTOBSERVER_KQUEUE_M@ OFKERNELEVENTOBSERVER_POLL_M = @OFKERNELEVENTOBSERVER_POLL_M@ OFKERNELEVENTOBSERVER_SELECT_M = @OFKERNELEVENTOBSERVER_SELECT_M@ OFSTDIOSTREAM_WIN32CONSOLE_M = @OFSTDIOSTREAM_WIN32CONSOLE_M@ OFZIP = @OFZIP@ -PROPERTIESTESTS_M = @PROPERTIESTESTS_M@ REEXPORT_LIBOBJC = @REEXPORT_LIBOBJC@ RUNTIME = @RUNTIME@ RUNTIME_A = @RUNTIME_A@ RUNTIME_RUNTIME_A = @RUNTIME_RUNTIME_A@ RUNTIME_RUNTIME_LIB_A = @RUNTIME_RUNTIME_LIB_A@ Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -23,11 +23,11 @@ OFStringTests.m \ OFURLTests.m \ OFXMLElementBuilderTests.m \ OFXMLNodeTests.m \ OFXMLParserTests.m \ - ${PROPERTIESTESTS_M} \ + RuntimeTests.m \ TestsAppDelegate.m \ ${USE_SRCS_FILES} \ ${USE_SRCS_PLUGINS} \ ${USE_SRCS_SOCKETS} \ ${USE_SRCS_THREADS} \ DELETED tests/PropertiesTests.m Index: tests/PropertiesTests.m ================================================================== --- tests/PropertiesTests.m +++ tests/PropertiesTests.m @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 - * Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "OFString.h" -#import "OFAutoreleasePool.h" - -#import "TestsAppDelegate.h" - -static OFString *module = @"Properties"; - -@interface PropertiesTest: OFObject -{ - OFString *foo; - OFString *bar; -} - -@property (copy, nonatomic) OFString *foo; -@property (retain) OFString *bar; -@end - -@implementation PropertiesTest -@synthesize foo; -@synthesize bar; - -- (void)dealloc -{ - [foo release]; - [bar release]; - - [super dealloc]; -} -@end - -@implementation TestsAppDelegate (PropertiesTests) -- (void)propertiesTests -{ - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; - PropertiesTest *pt = [[[PropertiesTest alloc] init] autorelease]; - OFString *t = [OFMutableString stringWithString: @"foo"]; - OFString *foo = @"foo"; - - [pt setFoo: t]; - TEST(@"copy, nonatomic", [[pt foo] isEqual: foo] && - [pt foo] != foo && [[pt foo] retainCount] == 1) - - [pt setBar: t]; - TEST(@"retain, atomic", [pt bar] == t && [t retainCount] == 3) - - [pool drain]; -} -@end ADDED tests/RuntimeTests.m Index: tests/RuntimeTests.m ================================================================== --- tests/RuntimeTests.m +++ tests/RuntimeTests.m @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#include "config.h" + +#import "OFString.h" +#import "OFAutoreleasePool.h" + +#import "TestsAppDelegate.h" + +static OFString *module = @"Runtime"; + +@interface RuntimeTest: OFObject +{ + OFString *_foo, *_bar; +} + +@property (copy, nonatomic) OFString *foo; +@property (retain) OFString *bar; +@end + +@implementation RuntimeTest +@synthesize foo = _foo; +@synthesize bar = _bar; + +- (void)dealloc +{ + [_foo release]; + [_bar release]; + + [super dealloc]; +} +@end + +@implementation TestsAppDelegate (RuntimeTests) +- (void)runtimeTests +{ + OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + RuntimeTest *rt = [[[RuntimeTest alloc] init] autorelease]; + OFString *t = [OFMutableString stringWithString: @"foo"]; + OFString *foo = @"foo"; + + [rt setFoo: t]; + TEST(@"copy, nonatomic properties", [[rt foo] isEqual: foo] && + [rt foo] != foo && [[rt foo] retainCount] == 1) + + [rt setBar: t]; + TEST(@"retain, atomic properties", + [rt bar] == t && [t retainCount] == 3) + + [pool drain]; +} +@end Index: tests/TestsAppDelegate.h ================================================================== --- tests/TestsAppDelegate.h +++ tests/TestsAppDelegate.h @@ -130,12 +130,12 @@ @interface TestsAppDelegate (OFPluginTests) - (void)pluginTests; @end -@interface TestsAppDelegate (PropertiesTests) -- (void)propertiesTests; +@interface TestsAppDelegate (RuntimeTests) +- (void)runtimeTests; @end @interface TestsAppDelegate (OFRIPEMD160HashTests) - (void)RIPEMD160HashTests; @end Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -359,10 +359,12 @@ #if defined(OF_WII) && defined(OF_HAVE_FILES) [[OFFileManager defaultManager] changeCurrentDirectoryPath: @"/apps/objfw-tests"]; #endif + [self runtimeTests]; + [self forwardingTests]; [self objectTests]; #ifdef OF_HAVE_BLOCKS [self blockTests]; #endif [self stringTests]; @@ -404,12 +406,10 @@ #endif [self JSONTests]; #ifdef OF_HAVE_PLUGINS [self pluginTests]; #endif - [self forwardingTests]; - [self propertiesTests]; #if defined(OF_WII) [self outputString: @"Press home button to exit!\n" inColor: NO_COLOR]; for (;;) {