Commits

Tuukka Norri committed 06e9f57

The garbage collection runner will now be installed if GC is on

Comments (0)

Files changed (4)

UnitTests/Sources/BXGarbageCollectionRunner.h

 @interface BXGarbageCollectionRunner : NSObject 
 {
 }
++ (void) install;
++ (void) run;
 @end

UnitTests/Sources/BXGarbageCollectionRunner.m

 	{
 		tooLate = YES;
 		if ([NSGarbageCollector defaultCollector])
+		{
+			NSLog (@"Garbage collection is enabled; installing GC runner.");
 			[NSThread detachNewThreadSelector: @selector (run) toTarget: self withObject: nil];
+		}
+		else
+		{
+			NSLog (@"Garbage collection is disabled; not installing GC runner.");
+		}
 	}
 }
 

UnitTests/Sources/BXMetadataTests.m

 }
 
 
-- (void) test0SchemaVersion
+- (void) test1Compatibility
+{
+	MKCAssertTrue ([mDatabaseDescription hasCompatibleBaseTenSchemaVersion]);
+}
+
+
+- (void) test2SchemaVersion
 {
 	NSNumber *currentVersion = [BXPGVersion currentVersionNumber];
 	NSNumber *currentCompatVersion = [BXPGVersion currentCompatibilityVersionNumber];
 }
 
 
-- (void) test1ViewPkey
+- (void) test3ViewPkey
 {
 	MKCAssertNotNil (mDatabaseDescription);
 	PGTSTableDescription* table = [mDatabaseDescription table: @"test_v" inSchema: @"public"];

UnitTests/Sources/TestLoader.m

 #import <BaseTen/BXLogger.h>
 #import <BaseTen/BXSocketDescriptor.h>
 #import "MKCSenTestCaseAdditions.h"
+#import "BXGarbageCollectionRunner.h"
 
 #import "PGTSInvocationRecorderTests.h"
 #import "BXHOMTests.h"
 {
 	BXLogSetLevel (kBXLogLevelWarning);
 	BXLogSetAbortsOnAssertionFailure (YES);
+	[BXGarbageCollectionRunner install];
+	//NSLog (@"waiting");
+	//sleep (10);
 	
 	NSArray* testClasses = [NSArray arrayWithObjects:
 							[PGTSInvocationRecorderTests class],
 							[ToOneChangeNotificationTests class],
 							nil];
 	
-	//testClasses = [NSArray arrayWithObject: [BXHostResolverTests class]];
+	//testClasses = [NSArray arrayWithObject: [BXSQLTests class]];
 	
 	for (int i = 0; i < 2; i++)
 	{