From 6b1cdbd19c50fdcc1cc09d5040dcc5f3cc54e1d5 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Tue, 21 Sep 2021 10:58:03 +0200 Subject: [PATCH] Fixed: Removed compiler warnings from test cases --- .../01_WithoutBindings/WithoutBindingsTest.j | 5 +++-- Tests/Foundation/CPDataTest.j | 2 ++ Tests/Foundation/CPDecimalTest.j | 1 - Tests/Foundation/CPDictionaryTest.j | 2 +- Tests/Foundation/CPGeometryTest.j | 1 - Tests/Foundation/CPKVCArrayTest.j | 15 +++++---------- Tests/Foundation/CPKeyValueObservingTest.j | 3 +-- Tests/Foundation/CPSetTest.j | 6 ++---- 8 files changed, 14 insertions(+), 21 deletions(-) diff --git a/Tests/AppKit/WithAndWithoutBindingsIntegration/01_WithoutBindings/WithoutBindingsTest.j b/Tests/AppKit/WithAndWithoutBindingsIntegration/01_WithoutBindings/WithoutBindingsTest.j index 9aadbb1aa..fa8b51112 100644 --- a/Tests/AppKit/WithAndWithoutBindingsIntegration/01_WithoutBindings/WithoutBindingsTest.j +++ b/Tests/AppKit/WithAndWithoutBindingsIntegration/01_WithoutBindings/WithoutBindingsTest.j @@ -38,8 +38,9 @@ - (void)test { - var theDocument = [MyDocument new], - cib = [CPBundle loadCibFile:[[CPBundle bundleForClass:WithoutBindingsTest] pathForResource:"01_WithoutBindings.cib"] externalNameTable:[CPDictionary dictionaryWithObject:theDocument forKey:CPCibOwner]]; + var theDocument = [MyDocument new]; + + [CPBundle loadCibFile:[[CPBundle bundleForClass:WithoutBindingsTest] pathForResource:"01_WithoutBindings.cib"] externalNameTable:[CPDictionary dictionaryWithObject:theDocument forKey:CPCibOwner]]; [theDocument windowControllerDidLoadCib:self]; diff --git a/Tests/Foundation/CPDataTest.j b/Tests/Foundation/CPDataTest.j index 7a97a1850..723ab8f24 100644 --- a/Tests/Foundation/CPDataTest.j +++ b/Tests/Foundation/CPDataTest.j @@ -4,6 +4,8 @@ @import @import +@global require; + @implementation CPDataTest : OJTestCase { } diff --git a/Tests/Foundation/CPDecimalTest.j b/Tests/Foundation/CPDecimalTest.j index 7f88d8c14..2c17741c7 100644 --- a/Tests/Foundation/CPDecimalTest.j +++ b/Tests/Foundation/CPDecimalTest.j @@ -418,7 +418,6 @@ // test addition of positives var d1 = CPDecimalMakeWithString(@"1"), d2 = CPDecimalMakeWithParts(1, 0), - dcm = CPDecimalMakeZero(), i = 50; while (i--) [self assert:CPDecimalAdd(d1, d1, d2, CPRoundPlain) equals:CPCalculationNoError message:"CPDecimalAdd() Tap1: addition"]; diff --git a/Tests/Foundation/CPDictionaryTest.j b/Tests/Foundation/CPDictionaryTest.j index 2cbcd64b7..505a83c07 100644 --- a/Tests/Foundation/CPDictionaryTest.j +++ b/Tests/Foundation/CPDictionaryTest.j @@ -88,7 +88,7 @@ - (void)testDictionaryWithJSObjectNonRecursive { - var non_recursive_dict = [CPDictionary dictionaryWithJSObject:json recursively:NO]; + [CPDictionary dictionaryWithJSObject:json recursively:NO]; } - (void)testCopy diff --git a/Tests/Foundation/CPGeometryTest.j b/Tests/Foundation/CPGeometryTest.j index b902744b0..cb3e7ae19 100644 --- a/Tests/Foundation/CPGeometryTest.j +++ b/Tests/Foundation/CPGeometryTest.j @@ -307,7 +307,6 @@ - (void)testCPPointMakeZero { - var point = CGPointMake(10, 20); [self assertTrue:CGPointEqualToPoint(CGPointMake(0, 0), CPPointMakeZero(0, 0))]; } diff --git a/Tests/Foundation/CPKVCArrayTest.j b/Tests/Foundation/CPKVCArrayTest.j index 9b326ca40..b92cce9a7 100644 --- a/Tests/Foundation/CPKVCArrayTest.j +++ b/Tests/Foundation/CPKVCArrayTest.j @@ -333,8 +333,7 @@ var COUNTER; - (void)testKVCCountArrayOperators { - var one = [1, 1, 1, 1, 1, 1, 1, 1], - two = [1, 2, 3, 4, 8, 0]; + var one = [1, 1, 1, 1, 1, 1, 1, 1]; [self assert:[one valueForKey:"@count"] equals:8]; @@ -345,8 +344,7 @@ var COUNTER; - (void)testKVCSumArrayOperators { - var one = [1, 1, 1, 1, 1, 1, 1, 1], - two = [1, 2, 3, 4, 8, 0]; + var one = [1, 1, 1, 1, 1, 1, 1, 1]; [self assert:[one valueForKeyPath:"@sum.intValue"] equals:8]; @@ -363,8 +361,7 @@ var COUNTER; - (void)testKVCAvgArrayOperators { - var one = [1, 1, 1, 1, 1, 1, 1, 1], - two = [1, 2, 3, 4, 8, 0]; + var two = [1, 2, 3, 4, 8, 0]; [self assert:[two valueForKeyPath:"@avg.intValue"] equals:3]; @@ -377,8 +374,7 @@ var COUNTER; - (void)testKVCMinArrayOperators { - var one = [1, 1, 1, 1, 1, 1, 1, 1], - two = [1, 2, 3, 4, 8, 0]; + var two = [1, 2, 3, 4, 8, 0]; [self assert:[two valueForKeyPath:"@min.intValue"] equals:0]; @@ -392,8 +388,7 @@ var COUNTER; - (void)testKVCMaxArrayOperators { - var one = [1, 1, 1, 1, 1, 1, 1, 1], - two = [1, 2, 3, 4, 8, 0]; + var two = [1, 2, 3, 4, 8, 0]; [self assert:[two valueForKeyPath:"@max.intValue"] equals:8]; diff --git a/Tests/Foundation/CPKeyValueObservingTest.j b/Tests/Foundation/CPKeyValueObservingTest.j index 76da13b72..c3a17782c 100644 --- a/Tests/Foundation/CPKeyValueObservingTest.j +++ b/Tests/Foundation/CPKeyValueObservingTest.j @@ -284,8 +284,7 @@ var _getCheeseCounter; - (void)testOnlyInsertObject_AtKeyIndex_Implemented { var insertSelector = @selector(insertObject:inObjectsAtIndex:), - object = [self objectWithMethods:insertSelector], - methodTypes = class_getInstanceMethod(object.isa, insertSelector).method_types; + object = [self objectWithMethods:insertSelector]; // Sanity check [self assert:class_getInstanceMethod(object.isa, insertSelector) diff --git a/Tests/Foundation/CPSetTest.j b/Tests/Foundation/CPSetTest.j index e0b139d4c..f5ecc451c 100644 --- a/Tests/Foundation/CPSetTest.j +++ b/Tests/Foundation/CPSetTest.j @@ -257,8 +257,7 @@ - (void)testKVCSumSetOperators { - var one = [CPSet setWithArray:[@"one", @"two", @"three"]], - two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]]; + var two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]]; [self assert:[two valueForKeyPath:"@sum.intValue"] equals:18]; @@ -271,8 +270,7 @@ - (void)testKVCAvgSetOperators { - var one = [CPSet setWithArray:[@"one", @"two", @"three"]], - two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]]; + var two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]]; [self assert:[two valueForKeyPath:"@avg.doubleValue"] equals:3.0];