From 46ef2c7a932b3706b520976468f1ee5f718d6bc3 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 11 Jul 2021 11:29:52 +0200 Subject: [PATCH] Fix tests. --- test/tests/model_test.js | 6 +++--- test/utils/testutils.js | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/tests/model_test.js b/test/tests/model_test.js index 6189302..1352c42 100644 --- a/test/tests/model_test.js +++ b/test/tests/model_test.js @@ -110,7 +110,7 @@ describe ('Model Finalization', function() { var model = new OV.Model (); var meshIndex = model.AddMesh (mesh); assert.strictEqual (model.MaterialCount (), 0); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); assert.strictEqual (model.MaterialCount (), 1); var theMesh = model.GetMesh (meshIndex); assert.strictEqual (theMesh.NormalCount (), 1); @@ -139,7 +139,7 @@ describe ('Model Finalization', function() { var model = new OV.Model () var meshIndex = model.AddMesh (mesh); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); var theMesh = model.GetMesh (meshIndex); assert.strictEqual (theMesh.NormalCount (), 6); @@ -172,7 +172,7 @@ describe ('Model Finalization', function() { var model = new OV.Model () var meshIndex = model.AddMesh (mesh); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); var theMesh = model.GetMesh (meshIndex); assert.strictEqual (theMesh.NormalCount (), 9); diff --git a/test/utils/testutils.js b/test/utils/testutils.js index 7eac6f6..4d4dd81 100644 --- a/test/utils/testutils.js +++ b/test/utils/testutils.js @@ -148,7 +148,7 @@ module.exports = let cube2 = OV.GenerateCuboid (new OV.GeneratorParams ().SetTransformationMatrix (matrix), 1.0, 1.0, 1.0); model.AddMesh (cube2); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); return model; }, @@ -163,11 +163,10 @@ module.exports = let cube2 = OV.GenerateCuboid (new OV.GeneratorParams ().SetTransformationMatrix (matrix), 1.0, 1.0, 1.0); model.AddMesh (cube2); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); return model; }, - GetTwoCubesConnectingInOneFaceModel () { let model = new OV.Model (); @@ -179,7 +178,7 @@ module.exports = let cube2 = OV.GenerateCuboid (new OV.GeneratorParams ().SetTransformationMatrix (matrix), 1.0, 1.0, 1.0); model.AddMesh (cube2); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); return model; }, @@ -228,7 +227,7 @@ module.exports = { var model = new OV.Model (); model.AddMesh (mesh); - OV.FinalizeModel (model, function () { new OV.Material () }); + OV.FinalizeModel (model, function () { return new OV.Material () }); return model; } }