From 243024e2322b3208b298e7e3f276af275034a4fe Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Wed, 26 Nov 2014 13:12:39 -0800 Subject: [PATCH] Fix broken tests due to new objj type checks --- Tests/AppKit/CPArrayControllerTest.j | 3 +++ Tests/AppKit/CPBrowserTest.j | 3 +++ Tests/AppKit/CPKeyValueBindingSimpleBindingsTest.j | 2 ++ Tests/AppKit/CPMenuValidatedUserInterfaceItemTest.j | 4 +++- Tests/AppKit/CPOutlineViewTest.j | 3 +++ Tests/AppKit/CPTokenFieldTest.j | 2 ++ Tests/Foundation/CPKVCArrayTest.j | 3 +++ Tests/Foundation/CPKVOTest.j | 3 +++ Tests/Foundation/CPKeyValueCodingTest.j | 3 +++ .../Preprocessor/OutputTests/Class/accessors.j | 4 ++-- .../Preprocessor/OutputTests/Class/accessors.js | 13 +++++++------ .../OutputTests/Class/root-class-multiple-ivars.j | 2 +- .../OutputTests/Class/root-class-multiple-ivars.js | 3 +-- .../OutputTests/Class/root-class-one-ivar.j | 3 +-- .../OutputTests/Class/root-class-one-ivar.js | 2 +- .../Preprocessor/OutputTests/Class/root-class.j | 2 +- .../Preprocessor/OutputTests/Class/root-class.js | 2 +- 17 files changed, 40 insertions(+), 17 deletions(-) diff --git a/Tests/AppKit/CPArrayControllerTest.j b/Tests/AppKit/CPArrayControllerTest.j index 3365cfdcf..35b8e3388 100644 --- a/Tests/AppKit/CPArrayControllerTest.j +++ b/Tests/AppKit/CPArrayControllerTest.j @@ -3,6 +3,9 @@ @import @import +@class Department +@class Employee + @implementation CPArrayControllerTest : OJTestCase { CPArrayController _arrayController @accessors(property=arrayController); diff --git a/Tests/AppKit/CPBrowserTest.j b/Tests/AppKit/CPBrowserTest.j index 420dfb279..bc29049bb 100644 --- a/Tests/AppKit/CPBrowserTest.j +++ b/Tests/AppKit/CPBrowserTest.j @@ -1,5 +1,8 @@ @import +@class CPBrowserDelegate + + @implementation CPBrowserTest : OJTestCase { CPBrowser browser; diff --git a/Tests/AppKit/CPKeyValueBindingSimpleBindingsTest.j b/Tests/AppKit/CPKeyValueBindingSimpleBindingsTest.j index d9c0e06d1..d1bb9af84 100644 --- a/Tests/AppKit/CPKeyValueBindingSimpleBindingsTest.j +++ b/Tests/AppKit/CPKeyValueBindingSimpleBindingsTest.j @@ -1,6 +1,8 @@ @import +@class Track + /*! Bindings tests exercising the functionality seen in the Cocoa example "SimpleBindingsAdoption". */ diff --git a/Tests/AppKit/CPMenuValidatedUserInterfaceItemTest.j b/Tests/AppKit/CPMenuValidatedUserInterfaceItemTest.j index e60c456db..5757c368d 100644 --- a/Tests/AppKit/CPMenuValidatedUserInterfaceItemTest.j +++ b/Tests/AppKit/CPMenuValidatedUserInterfaceItemTest.j @@ -1,5 +1,7 @@ var CPMenuValidatedUserInterfaceItemTestValidatedItems = []; +@class MenuTarget + @implementation CPMenuValidatedUserInterfaceItemTest : OJTestCase { CPMenu _menu @accessors(property=menu); @@ -83,4 +85,4 @@ var CPMenuValidatedUserInterfaceItemTestValidatedItems = []; } -@end \ No newline at end of file +@end diff --git a/Tests/AppKit/CPOutlineViewTest.j b/Tests/AppKit/CPOutlineViewTest.j index 65219ea41..129c6965b 100644 --- a/Tests/AppKit/CPOutlineViewTest.j +++ b/Tests/AppKit/CPOutlineViewTest.j @@ -1,5 +1,8 @@ @import +@class TestOutlineDataSource + + @implementation CPOutlineViewTest : OJTestCase { CPOutlineView outlineView; diff --git a/Tests/AppKit/CPTokenFieldTest.j b/Tests/AppKit/CPTokenFieldTest.j index 6c8320eeb..cd65113ad 100644 --- a/Tests/AppKit/CPTokenFieldTest.j +++ b/Tests/AppKit/CPTokenFieldTest.j @@ -1,5 +1,7 @@ @import +@class TestDelegateTokenField + [CPApplication sharedApplication]; @implementation CPTokenFieldTest : OJTestCase diff --git a/Tests/Foundation/CPKVCArrayTest.j b/Tests/Foundation/CPKVCArrayTest.j index 12e5edd52..6948d4177 100644 --- a/Tests/Foundation/CPKVCArrayTest.j +++ b/Tests/Foundation/CPKVCArrayTest.j @@ -1,5 +1,8 @@ var COUNTER; +@class TestObject +@class ImplementedTestObject + @implementation CPKVCArrayTest : OJTestCase { TestObject _object @accessors(property=object); diff --git a/Tests/Foundation/CPKVOTest.j b/Tests/Foundation/CPKVOTest.j index 1fa905abd..631e2ac80 100644 --- a/Tests/Foundation/CPKVOTest.j +++ b/Tests/Foundation/CPKVOTest.j @@ -1,6 +1,9 @@ @import @import +@class CarTester +@class ToManyTester + @implementation CPKVOTest : OJTestCase { BOOL _sawInitialObservation; diff --git a/Tests/Foundation/CPKeyValueCodingTest.j b/Tests/Foundation/CPKeyValueCodingTest.j index ac57d9f02..ccf560401 100644 --- a/Tests/Foundation/CPKeyValueCodingTest.j +++ b/Tests/Foundation/CPKeyValueCodingTest.j @@ -22,6 +22,9 @@ @import +@class Department2 +@class Employee2 + var accessIVARS = YES; @implementation KVCTestClass : CPObject diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.j b/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.j index fe7fcc5de..820cad2f6 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.j +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.j @@ -1,10 +1,10 @@ -@implementation Class +@implementation TestClass { } @end -@implementation Class (Accessors) +@implementation TestClass (Accessors) { Type ivar @accessors; } diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.js b/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.js index 9db2e1754..ae78cbb53 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/accessors.js @@ -1,13 +1,14 @@ -var the_class=objj_allocateClassPair(Nil,"Class"),meta_class=the_class.isa; +var the_class=objj_allocateClassPair(Nil,"TestClass"),meta_class=the_class.isa; objj_registerClassPair(the_class); -var the_class=objj_getClass("Class"); +var the_class=objj_getClass("TestClass"); if(!the_class){ -throw new SyntaxError("*** Could not find definition for class \"Class\""); +throw new SyntaxError("*** Could not find definition for class \"TestClass\""); } var meta_class=the_class.isa; class_addIvars(the_class,[new objj_ivar("ivar")]); -class_addMethods(the_class,[new objj_method(sel_getUid("ivar"),function $Class__ivar(_1,_2){ +class_addMethods(the_class,[new objj_method(sel_getUid("ivar"),function $TestClass__ivar(_1,_2){ return _1.ivar; -},["Type"]),new objj_method(sel_getUid("setIvar:"),function $Class__setIvar_(_3,_4,_5){ +},["Type"]),new objj_method(sel_getUid("setIvar:"),function $TestClass__setIvar_(_3,_4,_5){ _3.ivar=_5; -},["void","Type"])]); \ No newline at end of file +},["void","Type"])]); + diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.j b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.j index 50d1fa504..603bc25e5 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.j +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.j @@ -1,5 +1,5 @@ -@implementation Class +@implementation TestClass { Type ivar; CPArray array; diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.js b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.js index 7eba069a9..8cf16dc3b 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-multiple-ivars.js @@ -1,5 +1,4 @@ - -var the_class = objj_allocateClassPair(Nil, "Class"), +var the_class = objj_allocateClassPair(Nil, "TestClass"), meta_class = the_class.isa; class_addIvars(the_class,[new objj_ivar("ivar"), new objj_ivar("array"), new objj_ivar("string"), new objj_ivar("integer")]); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.j b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.j index 14fc4dd73..3aebab79d 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.j +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.j @@ -1,5 +1,4 @@ - -@implementation Class +@implementation TestClass { Type ivar; } diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.js b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.js index 4c6f93642..165c23dc8 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class-one-ivar.js @@ -1,5 +1,5 @@ -var the_class = objj_allocateClassPair(Nil, "Class"), +var the_class = objj_allocateClassPair(Nil, "TestClass"), meta_class = the_class.isa; class_addIvars(the_class,[new objj_ivar("ivar")]); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.j b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.j index f0e079126..6f4f77d3d 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.j +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.j @@ -1,5 +1,5 @@ -@implementation Class +@implementation TestClass { } @end diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.js b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.js index c266954fc..75528fb97 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Class/root-class.js @@ -1,5 +1,5 @@ -var the_class = objj_allocateClassPair(Nil, "Class"), +var the_class = objj_allocateClassPair(Nil, "TestClass"), meta_class = the_class.isa; objj_registerClassPair(the_class);