diff --git a/Tests/AppKit/CGContextTest.j b/Tests/AppKit/CGContextTest.j index 40288a0dd..1601430f7 100644 --- a/Tests/AppKit/CGContextTest.j +++ b/Tests/AppKit/CGContextTest.j @@ -2,6 +2,10 @@ @import "CGTestCase.j" +// These are left undefined in CGContext.j if CPFeatureIsCompatible(CPHTMLCanvasFeature) +@global CGGStateCreate +@global CGGStateCreateCopy + @implementation CGContextTest : CGTestCase - (void)testEnsureTestingCanvas diff --git a/Tests/AppKit/CPCheckBoxTest.j b/Tests/AppKit/CPCheckBoxTest.j index 076850943..178ecba35 100644 --- a/Tests/AppKit/CPCheckBoxTest.j +++ b/Tests/AppKit/CPCheckBoxTest.j @@ -14,7 +14,8 @@ var control = [[CPCheckBox alloc] initWithFrame:CGRectMakeZero()]; [control setAllowsMixedState:YES]; - var content = [ + var content = + [ CPOffState, CPOnState ], @@ -78,11 +79,12 @@ { var control = [[CPCheckBox alloc] initWithFrame:CGRectMakeZero()]; - content = [ - [CPDictionary dictionaryWithObject:YES forKey:@"state"], - [CPDictionary dictionaryWithObject:NO forKey:@"state"] - ]; - arrayController = [[CPArrayController alloc] initWithContent:content]; + var content = + [ + [CPDictionary dictionaryWithObject:YES forKey:@"state"], + [CPDictionary dictionaryWithObject:NO forKey:@"state"] + ], + arrayController = [[CPArrayController alloc] initWithContent:content]; // First test defaults. [control bind:CPValueBinding toObject:arrayController withKeyPath:@"selection.state" options:[CPDictionary dictionaryWithObject:@"CPNegateBoolean" forKey:CPValueTransformerNameBindingOption]]; diff --git a/Tests/AppKit/CPKeyValueBindingTest.j b/Tests/AppKit/CPKeyValueBindingTest.j index f6a184f01..15b614874 100644 --- a/Tests/AppKit/CPKeyValueBindingTest.j +++ b/Tests/AppKit/CPKeyValueBindingTest.j @@ -160,7 +160,7 @@ [tableView addTableColumn:tableColumn]; - content = [ + var content = [ [AccessCounter counterWithValueA:"1" valueB:"2"], [AccessCounter counterWithValueA:"3" valueB:"4"], [AccessCounter counterWithValueA:"5" valueB:"6"], @@ -229,7 +229,7 @@ [textField bind:@"hidden" toObject:self withKeyPath:@"FOO" options:nil]; [self assert:@"cheese" equals:[textField placeholderString] message:"placeholder should not be cleared when a binding is established"]; - content = [ + var content = [ [BindingTester testerWithCheese:@"yellow"], [BindingTester testerWithCheese:@"green"], ]; diff --git a/Tests/AppKit/CPResponderTest.j b/Tests/AppKit/CPResponderTest.j index 6ce54098a..8bc0a940b 100644 --- a/Tests/AppKit/CPResponderTest.j +++ b/Tests/AppKit/CPResponderTest.j @@ -41,6 +41,7 @@ selector = tests[i + 2]; responder.doCommandCalls = []; + var keyEvent = [CPEvent keyEventWithType:CPKeyDown location:CGPointMakeZero() modifierFlags:0 timestamp:0 windowNumber:0 context:nil characters:character charactersIgnoringModifiers:character isARepeat:NO keyCode:keyCode]; @@ -52,6 +53,7 @@ - (void)testInterpretKeyEventsWithModifierFlags { responder.doCommandCalls = []; + var keyEvent = [CPEvent keyEventWithType:CPKeyDown location:CGPointMakeZero() modifierFlags:CPShiftKeyMask timestamp:0 windowNumber:0 context:nil characters:CPLeftArrowFunctionKey charactersIgnoringModifiers:CPLeftArrowFunctionKey isARepeat:NO keyCode:CPKeyCodes.LEFT]; diff --git a/Tests/AppKit/CPSliderTest.j b/Tests/AppKit/CPSliderTest.j index 9f74ffdad..d80184aff 100644 --- a/Tests/AppKit/CPSliderTest.j +++ b/Tests/AppKit/CPSliderTest.j @@ -23,6 +23,7 @@ var slider = [[CPSlider alloc] initWithFrame:CGRectMakeZero()]; [slider setContinuous:NO]; + var decoded = [CPKeyedUnarchiver unarchiveObjectWithData:[CPKeyedArchiver archivedDataWithRootObject:slider]]; [self assert:[slider isContinuous] equals:[decoded isContinuous] message:@"a decoded slider should preserve isContinuous (NO case)"]; diff --git a/Tests/Foundation/CPArrayPerformanceTest.j b/Tests/Foundation/CPArrayPerformanceTest.j index b80343648..581364d27 100644 --- a/Tests/Foundation/CPArrayPerformanceTest.j +++ b/Tests/Foundation/CPArrayPerformanceTest.j @@ -5,6 +5,8 @@ var FILE = require("file"); @import @import +@global module + var ELEMENTS = 100, REPEATS = 10; diff --git a/Tests/Foundation/CPDecimalTest.j b/Tests/Foundation/CPDecimalTest.j index 4a0166038..442aaa03d 100644 --- a/Tests/Foundation/CPDecimalTest.j +++ b/Tests/Foundation/CPDecimalTest.j @@ -143,11 +143,8 @@ - (void)testNormalize { - var dcm1, - dcm2; - - dcm1 = CPDecimalMakeWithString( @"200" ); - dcm2 = CPDecimalMakeWithString( @"2" ); + var dcm1 = CPDecimalMakeWithString( @"200" ), + dcm2 = CPDecimalMakeWithString( @"2" ); [self assert:0 equals:CPDecimalNormalize(dcm1,dcm2,CPRoundDown) message:"CPDecimalNormalise() Tn1:call" ]; [self assert:[2,0,0] equals:dcm1._mantissa message:"CPDecimalNormalise() Tn1: mantissa"]; [self assert:0 equals:dcm1._exponent message:"CPDecimalNormalise() Tn1: exponent"]; diff --git a/Tests/Foundation/CPExceptionTest.j b/Tests/Foundation/CPExceptionTest.j index 9c038223d..5296ce5d9 100644 --- a/Tests/Foundation/CPExceptionTest.j +++ b/Tests/Foundation/CPExceptionTest.j @@ -7,7 +7,7 @@ - (void)setUp { - exception = [CPException exceptionWithName:@"CPGenericException" + var exception = [CPException exceptionWithName:@"CPGenericException" reason:@"Margins must be positive" userInfo:nil]; } diff --git a/Tests/Foundation/CPFunctionOperationTest.j b/Tests/Foundation/CPFunctionOperationTest.j index a713abdea..5165029fb 100644 --- a/Tests/Foundation/CPFunctionOperationTest.j +++ b/Tests/Foundation/CPFunctionOperationTest.j @@ -19,8 +19,8 @@ { var so = [[SomeObject alloc] init], someVar = nil, + funcOp = [CPFunctionOperation functionOperationWithFunction:function() {[so setAString:@"Hello World"]}]; - funcOp = [CPFunctionOperation functionOperationWithFunction:function() { [so setAString:@"Hello World"] }]; [funcOp addExecutionFunction:function() {someVar = 'Soylent Green';}]; [funcOp start]; diff --git a/Tests/Foundation/CPMutableArrayTest.j b/Tests/Foundation/CPMutableArrayTest.j index 4cdf8cbee..8f47a316b 100644 --- a/Tests/Foundation/CPMutableArrayTest.j +++ b/Tests/Foundation/CPMutableArrayTest.j @@ -449,11 +449,8 @@ - (void)testMutableCopy { - var normalArray = [CPArray array]; - - [self assertThrows:function () { [array addObject:[CPNull null]] }]; - - var mutableArray = [normalArray mutableCopy]; + var normalArray = [], + mutableArray = [normalArray mutableCopy]; [mutableArray addObject:[CPNull null]]; diff --git a/Tests/Objective-J/CFPropertyListTest.j b/Tests/Objective-J/CFPropertyListTest.j index 9534a81f2..ad6e9c643 100644 --- a/Tests/Objective-J/CFPropertyListTest.j +++ b/Tests/Objective-J/CFPropertyListTest.j @@ -1,3 +1,4 @@ +@global module var FILE = require("file"), FileList = require("jake").FileList; @@ -19,7 +20,7 @@ var FILE = require("file"), var path = FILE.join(FILE.dirname(module.path), "PropertyLists/XMLDate.plist"), object = CFPropertyList.readPropertyListFromFile(path), date = [object objectForKey:@"date"]; - + [self assert:[CPDate class] equals:[date class]]; [self assert:[[CPDate alloc] initWithString:"2012-01-01 10:00:00 +0100"] equals:date]; }