From 6e3f82299ff3e255ae6b81d520e99fe0df82e2db Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Fri, 11 Jan 2013 00:48:18 +0000 Subject: [PATCH 1/3] Add missing source header. --- AppKit/CPTreeNode.j | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/AppKit/CPTreeNode.j b/AppKit/CPTreeNode.j index f34c51537..9e2871218 100644 --- a/AppKit/CPTreeNode.j +++ b/AppKit/CPTreeNode.j @@ -1,3 +1,24 @@ +/* + * CPTreeNode.j + * AppKit + * + * Created by Francisco Tolmasky. + * Copyright 2009, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ @import @import From 18f8294fa994fac17bf158bd4ec0dd30ad531fee Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Thu, 10 Jan 2013 22:40:15 -0800 Subject: [PATCH 2/3] Update order of variable to tets in assert --- Tests/Tools/ToolsTest.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Tools/ToolsTest.j b/Tests/Tools/ToolsTest.j index b44cd234b..b3e16e59e 100644 --- a/Tests/Tools/ToolsTest.j +++ b/Tests/Tools/ToolsTest.j @@ -22,13 +22,13 @@ function cleanup() { var status; status = OS.system(["capp", "gen", "ToolsTestApp"].map(OS.enquote).join(" ") + " > /dev/null"); - [self assert:status equals:0 message:"capp gen failed"]; + [self assert:0 equals:status message:"capp gen failed"]; status = OS.system(["press", "-f", "ToolsTestApp", "PressTestApp"].map(OS.enquote).join(" ") + " > /dev/null"); - [self assert:status equals:0 message:"press failed"]; + [self assert:0 equals:status message:"press failed"]; status = OS.system(["flatten", "-f", "ToolsTestApp", "FlattenTestApp"].map(OS.enquote).join(" ") + " > /dev/null"); - [self assert:status equals:0 message:"flatten failed"]; + [self assert:0 equals:status message:"flatten failed"]; } - (void)tearDown From 71f502a8e8d924a5bfb21785b91460fdd9843601 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Thu, 10 Jan 2013 23:04:12 -0800 Subject: [PATCH 3/3] Fix some ivar masking in tests --- Tests/AppKit/CPApplicationTest.j | 1 - Tests/AppKit/CPButtonTest.j | 2 +- Tests/AppKit/CPKeyValueBindingTest.j | 7 ++++--- Tests/AppKit/CPTableViewTest.j | 3 ++- Tests/Foundation/CPKVOTest.j | 9 +++++---- Tests/Foundation/CPSetTest.j | 1 - 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Tests/AppKit/CPApplicationTest.j b/Tests/AppKit/CPApplicationTest.j index 7ab0de490..9794f337d 100644 --- a/Tests/AppKit/CPApplicationTest.j +++ b/Tests/AppKit/CPApplicationTest.j @@ -90,7 +90,6 @@ var globalResults = []; - (void)testRunModalForWindow { - var aWindow = [[CPWindow alloc] init]; [app runModalForWindow:aWindow]; [self assertTrue:[aWindow isKeyWindow] message:@"A window must be made key when it's run modally"]; diff --git a/Tests/AppKit/CPButtonTest.j b/Tests/AppKit/CPButtonTest.j index 112d89020..e4d46af2c 100644 --- a/Tests/AppKit/CPButtonTest.j +++ b/Tests/AppKit/CPButtonTest.j @@ -181,7 +181,7 @@ - (void)testTypeMasks { - var button = [[CPButton alloc] initWithFrame:CGRectMakeZero()]; + button = [[CPButton alloc] initWithFrame:CGRectMakeZero()]; // The default mask should be that of CPMomentaryPushInButton. [self assert:CPPushInButtonMask | CPGrayButtonMask | CPBackgroundButtonMask equals:[button highlightsBy]]; diff --git a/Tests/AppKit/CPKeyValueBindingTest.j b/Tests/AppKit/CPKeyValueBindingTest.j index 9f2860a91..f6a184f01 100644 --- a/Tests/AppKit/CPKeyValueBindingTest.j +++ b/Tests/AppKit/CPKeyValueBindingTest.j @@ -154,8 +154,9 @@ - (void)testTableColumn { var tableView = [CPTableView new], - tableColumn = [[CPTableColumn alloc] initWithIdentifier:"A Column"], - arrayController = [CPArrayController new]; + tableColumn = [[CPTableColumn alloc] initWithIdentifier:"A Column"]; + + arrayController = [CPArrayController new]; [tableView addTableColumn:tableColumn]; @@ -401,4 +402,4 @@ return valueB; } -@end \ No newline at end of file +@end diff --git a/Tests/AppKit/CPTableViewTest.j b/Tests/AppKit/CPTableViewTest.j index e5cc03661..a103507dd 100644 --- a/Tests/AppKit/CPTableViewTest.j +++ b/Tests/AppKit/CPTableViewTest.j @@ -243,9 +243,10 @@ - (void)testContentBinding { var contentBindingTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)], - tableColumn = [[CPTableColumn alloc] initWithIdentifier:@"A"], delegate = [ContentBindingTableDelegate new]; + tableColumn = [[CPTableColumn alloc] initWithIdentifier:@"A"]; + [contentBindingTable addTableColumn:tableColumn]; [delegate setTester:self]; [contentBindingTable setDelegate:delegate]; diff --git a/Tests/Foundation/CPKVOTest.j b/Tests/Foundation/CPKVOTest.j index 619a0e7f8..f4614bf71 100644 --- a/Tests/Foundation/CPKVOTest.j +++ b/Tests/Foundation/CPKVOTest.j @@ -65,7 +65,7 @@ - (void)testDirectIVarObservation { - var bob = [[PersonTester alloc] init]; + bob = [[PersonTester alloc] init]; [bob addObserver:self forKeyPath:@"phoneNumber" options:nil context:@"testDirectIVarObservation"]; @@ -446,8 +446,9 @@ - (void)testSettersReplacedOnce { - var bob = [[PersonTester alloc] init], - betty = [CPObject new]; + var betty = [CPObject new]; + + bob = [[PersonTester alloc] init]; [bob addObserver:self forKeyPath:@"name" options:nil context:@"testSettersReplacedOnce"]; @@ -470,7 +471,7 @@ - (void)testNestedNotifications { - var bob = [[PersonTester alloc] init]; + bob = [[PersonTester alloc] init]; [bob willChangeValueForKey:@"name"]; [self assertTrue:bob._willChangeMessageCounter[@"name"] === 1]; diff --git a/Tests/Foundation/CPSetTest.j b/Tests/Foundation/CPSetTest.j index 3a6afc80a..5859347d0 100644 --- a/Tests/Foundation/CPSetTest.j +++ b/Tests/Foundation/CPSetTest.j @@ -4,7 +4,6 @@ @implementation CPSetTest : OJTestCase { - CPSet set; } - (void)assertSet:(CPSet)aSet onlyHasObjects:(CPArray)objects