Fixed: Removed warnings and cleanup for test cases when converting to Node

This commit is contained in:
Martin Carlberg
2021-09-15 17:31:20 +02:00
parent 8257632706
commit ab4c87e69f
10 changed files with 24 additions and 14 deletions
+2 -2
View File
@@ -32,8 +32,8 @@
- (void)testColorCreate
{
var colorspace = CGColorSpaceCreateDeviceRGB(),
components = [2,3,4,5],
clruid = CFHashCode(colorspace) + components.join("");
components = [2,3,4,5]/*,
clruid = CFHashCode(colorspace) + components.join("")*/;
// Can't access the colormap cache, but it would be nice to
// [self assert:NULL equals:_CGColorMap[clruid]];
+5 -3
View File
@@ -12,11 +12,13 @@
{
/*
Ensure that we have no canvas nor vml support.
Now when we are moving to Node we don't need to do this check anymore.
Before Node we had to check what engine we where running on to test correctly
*/
if (system.engine !== "jsc")
{
//if (system.engine !== "jsc")
//{
[self assert:YES equals:!CPFeatureIsCompatible(CPHTMLCanvasFeature)];
}
//}
[self assert:YES equals:!CPFeatureIsCompatible(CPVMLFeature)];
}
+3 -2
View File
@@ -875,8 +875,9 @@
- (void)testObservationDuringSetSelectionIndexes
{
var arrayController = [self arrayController],
newContent = [self setupObservationFixture];
var arrayController = [self arrayController];
[self setupObservationFixture];
var newSelection = [CPIndexSet indexSetWithIndex:2];
[arrayController setSelectionIndexes:newSelection];
+1
View File
@@ -26,6 +26,7 @@
var archived = [CPKeyedArchiver archivedDataWithRootObject:colorWell],
unarchived = [CPKeyedUnarchiver unarchiveObjectWithData:archived];
[self assertNotNull:unarchived];
[self assertFalse:[colorWell isBordered] message:"color well archived bordered state"];
[self assert:[CPColor greenColor] equals:[colorWell color] message:"color well archived color"];
}
@@ -109,6 +109,8 @@
// this code should run with or without that connection.
var cib = [CPBundle loadCibFile:[[CPBundle bundleForClass:CPKeyValueBindingSimpleBindingsTest] pathForResource:"SimpleBindingsAdoption_03.cib"] externalNameTable:@{ CPCibOwner: self }];
[self assertNotNull:cib];
// Test the interaction.
[textField setStringValue:@"0.7"];
// Simulate user interaction. By default bindings update on action only.
+6
View File
@@ -1,4 +1,5 @@
@import <AppKit/CPApplication.j>
@import <AppKit/CPKeyValueBinding.j>
@import <AppKit/CPTextField.j>
@@ -13,6 +14,7 @@
@import <AppKit/CPClipView.j>
@import <AppKit/CPTableView.j>
@import <AppKit/CPArrayController.j>
@import <AppKit/CPSegmentedControl.j>
@implementation CPKeyValueBindingTest : OJTestCase
{
@@ -358,7 +360,11 @@
[segmented bind:CPSelectedIndexBinding toObject:model withKeyPath:@"cheese" options:nil];
// Try to bind another binding (mutually exclusive) to the same value.
// Turn off logging so we don't get the warning about this
var saveCPLogDisable = CPLogDisable;
CPLogDisable = YES;
[segmented bind:CPSelectedTagBinding toObject:model withKeyPath:@"cheese" options:nil];
CPLogDisable = saveCPLogDisable;
[self assertNotNull:[segmented infoForBinding:CPSelectedIndexBinding]];
+2
View File
@@ -286,6 +286,8 @@
outlineView = decoded;
// Expansion state does not archive.
[outlineView expandItem:nil expandChildren:YES];
// Set the datasource or we will get warnings about this.
[outlineView setDataSource:dataSource];
// While not exhaustive, if this test works nothing is majorly broken with the unarchived outline view.
[self testCollapse];
}
+2 -6
View File
@@ -229,7 +229,6 @@
documentView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 1000, 1000)],
textField1 = [CPTextField textFieldWithStringValue:@"Martin" placeholder:@"" width:10],
textField2 = [CPTextField textFieldWithStringValue:@"Malte" placeholder:@"" width:10],
textField1Size = CGSizeMakeCopy([textField1 bounds].size),
textField2Size = CGSizeMakeCopy([textField2 bounds].size);
[scrollView setDocumentView:documentView];
@@ -277,9 +276,7 @@
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
documentView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 1000, 1000)],
view1 = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)],
view2 = [[CPView alloc] initWithFrame:CGRectMake(500, 500, 200, 200)],
view1Size = CGSizeMakeCopy([view1 bounds].size),
view2Size = CGSizeMakeCopy([view2 bounds].size);
view2 = [[CPView alloc] initWithFrame:CGRectMake(500, 500, 200, 200)];
[scrollView setDocumentView:documentView];
@@ -289,8 +286,7 @@
[documentView addSubview:view1];
[documentView addSubview:view2];
var visibleRect = [documentView visibleRect],
originalVisibleSize = CGSizeMakeCopy(visibleRect.size);
var visibleRect = [documentView visibleRect];
// Make sure we are at the top left corner
[self assertPoint:CGPointMake(0, 0) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner"];
-1
View File
@@ -194,7 +194,6 @@
for (var row = 0; row < 50; row++)
{
var column = row * 2;
contentArray.push([CPDictionary dictionaryWithObjects:["R" + row + "C0", "R" + row + "C1"] forKeys:["c1", "c2"]]);
}
[arrayController setContent:contentArray];
+1
View File
@@ -1,3 +1,4 @@
@import <AppKit/CPApplication.j>
@import <AppKit/CPTextView.j>
@import <OJMoq/OJMoq.j>