ok(actualParams.width==expectedParams.width,"OK, box width matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.height==expectedParams.height,"OK, box height matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.depth==expectedParams.depth,"OK, box depth matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.widthSegments==expectedParams.widthSegments,"OK, box widthSegments matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.heightSegments==expectedParams.heightSegments,"OK, box heightSegments matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.depthSegments==expectedParams.depthSegments,"OK, box depthSegments matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.width==expectedParams.width,"OK, box width matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.height==expectedParams.height,"OK, box height matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.depth==expectedParams.depth,"OK, box depth matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.widthSegments==expectedParams.widthSegments,"OK, box widthSegments matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.heightSegments==expectedParams.heightSegments,"OK, box heightSegments matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.depthSegments==expectedParams.depthSegments,"OK, box depthSegments matches the corresponding value from boxGeometry1 (after undo)");
ok(actualParams.width==expectedParams.width,"OK, box width matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.height==expectedParams.height,"OK, box height matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.depth==expectedParams.depth,"OK, box depth matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.widthSegments==expectedParams.widthSegments,"OK, box widthSegments matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.heightSegments==expectedParams.heightSegments,"OK, box heightSegments matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.depthSegments==expectedParams.depthSegments,"OK, box depthSegments matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.width==expectedParams.width,"OK, box width matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.height==expectedParams.height,"OK, box height matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.depth==expectedParams.depth,"OK, box depth matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.widthSegments==expectedParams.widthSegments,"OK, box widthSegments matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.heightSegments==expectedParams.heightSegments,"OK, box heightSegments matches the corresponding value from boxGeometry2 (after redo)");
ok(actualParams.depthSegments==expectedParams.depthSegments,"OK, box depthSegments matches the corresponding value from boxGeometry2 (after redo)");
"OK, "+attributeName+" was set correctly to the last value (expected: '"+testData[attributeName][length-1]+"', actual: '"+box.material[attributeName]+"')");
"OK, "+attributeName+" was set correctly to the last value (expected: '"+testData[attributeName][length-1]+"', actual: '"+box.material[attributeName]+"')");
"OK, "+attributeName+" was set correctly to the second to the last value after undo (expected: '"+testData[attributeName][length-2]+"', actual: '"+box.material[attributeName]+"')");
"OK, "+attributeName+" was set correctly to the second to the last value after undo (expected: '"+testData[attributeName][length-2]+"', actual: '"+box.material[attributeName]+"')");
"OK, "+attributeName+" was set correctly to the last value again after redo (expected: '"+testData[attributeName][length-1]+"', actual: '"+box.material[attributeName]+"')");
"OK, "+attributeName+" was set correctly to the last value again after redo (expected: '"+testData[attributeName][length-1]+"', actual: '"+box.material[attributeName]+"')");
"OK, 'source' was set correctly to the last value (expected: '"+testSourceData[length-1].source+"', actual: '"+editor.scripts[box.uuid][0]['source']+"')");
"OK, 'source' was set correctly to the last value (expected: '"+testSourceData[length-1].source+"', actual: '"+editor.scripts[box.uuid][0]['source']+"')");
"OK, 'source' was set correctly to the second to the last value after undo (expected: '"+testSourceData[length-2].source+"', actual: '"+editor.scripts[box.uuid][0]['source']+"')");
"OK, 'source' was set correctly to the second to the last value after undo (expected: '"+testSourceData[length-2].source+"', actual: '"+editor.scripts[box.uuid][0]['source']+"')");
"OK, 'source' was set correctly to the last value again after redo (expected: '"+testSourceData[length-1].source+"', actual: '"+editor.scripts[box.uuid][0]['source']+"')");
"OK, 'source' was set correctly to the last value again after redo (expected: '"+testSourceData[length-1].source+"', actual: '"+editor.scripts[box.uuid][0]['source']+"')");
// test name
varnames=["X Script","Y Script","Z Script"];
names.map(function(name){
...
...
@@ -59,17 +56,17 @@ test( "Test CmdSetScriptValue for source (Undo and Redo)", function() {
ok(object[item]==valueBefore," OK, the attribute '"+item+"' is correct after first execute (expected: '"+valueBefore+"', actual: '"+object[item]+"')");
ok(object[item]==valueBefore," OK, the attribute '"+item+"' is correct after first execute (expected: '"+valueBefore+"', actual: '"+object[item]+"')");
varcmd=newCmdSetValue(object,item,valueAfter);
cmd.updatable=false;
editor.execute(cmd);
ok(object[item]==valueAfter," OK, the attribute '"+item+"' is correct after second execute (expected: '"+valueAfter+"', actual: '"+object[item]+"')");
ok(object[item]==valueAfter," OK, the attribute '"+item+"' is correct after second execute (expected: '"+valueAfter+"', actual: '"+object[item]+"')");
editor.undo();
ok(object[item]==valueBefore," OK, the attribute '"+item+"' is correct after undo (expected: '"+valueBefore+"', actual: '"+object[item]+"')");
ok(object[item]==valueBefore," OK, the attribute '"+item+"' is correct after undo (expected: '"+valueBefore+"', actual: '"+object[item]+"')");
editor.redo();
ok(object[item]==valueAfter," OK, the attribute '"+item+"' is correct after redo (expected: '"+valueAfter+"', actual: '"+object[item]+"')");
ok(object[item]==valueAfter," OK, the attribute '"+item+"' is correct after redo (expected: '"+valueAfter+"', actual: '"+object[item]+"')");