From d919032b5524c117eb8b740e0a7a027e73619178 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 19 Apr 2019 11:56:28 +0300 Subject: [PATCH] Update unit-tests due to the issue #2941fix. For compounds of not only solids the volume value computed incorrectly. --- src/ExchangePlugin/Test/TestExport.py | 12 ++++++------ src/ExchangePlugin/Test/TestImport.py | 4 ++-- .../Test/TestPartitionSubCompsolidWithFace1.py | 6 +++--- .../Test/TestPartitionSubCompsolidWithFace2.py | 6 +++--- .../Test/TestPartitionSubCompsolidWithFace3.py | 6 +++--- .../Test/TestPartitionSubCompsolidWithFace4.py | 6 +++--- .../Test/TestPartitionSubCompsolidWithFace5.py | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ExchangePlugin/Test/TestExport.py b/src/ExchangePlugin/Test/TestExport.py index 353e7ea2c..2d8715698 100644 --- a/src/ExchangePlugin/Test/TestExport.py +++ b/src/ExchangePlugin/Test/TestExport.py @@ -172,15 +172,15 @@ if __name__ == '__main__': #========================================================================= # Export a shape into STEP #========================================================================= - testExport("STEP", "STEP", os.path.join(tmp_dir, "screw_export.step"), 3.78825807533e-06, 10 ** -17) - testExport("STP", "STEP", os.path.join(tmp_dir, "screw_export.stp"), 3.78825807533e-06, 10 ** -17) - testExport("Regular", "", os.path.join(tmp_dir, "screw_export.step"), 3.78825807533e-06, 10 ** -17) + testExport("STEP", "STEP", os.path.join(tmp_dir, "screw_export.step"), 3.788258075329978e-06, 10 ** -17) + testExport("STP", "STEP", os.path.join(tmp_dir, "screw_export.stp"), 3.788258075329978e-06, 10 ** -17) + testExport("Regular", "", os.path.join(tmp_dir, "screw_export.step"), 3.788258075329978e-06, 10 ** -17) #========================================================================= # Export a shape into IGES #========================================================================= - testExport("IGES-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.iges"), 3.78829613776e-06, 10 ** -17) - testExport("IGS-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.igs"), 3.78829613776e-06, 10 ** -17) - testExport("Regular", "", os.path.join(tmp_dir, "screw_export-5.1.iges"), 3.78829613776e-06, 10 ** -17) + testExport("IGES-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.iges"), 0.0019293313766693052, 10 ** -17) + testExport("IGS-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.igs"), 0.0019293313766693052, 10 ** -17) + testExport("Regular", "", os.path.join(tmp_dir, "screw_export-5.1.iges"), 0.0019293313766693052, 10 ** -17) testExport("IGES-5.3", "IGES-5.3", os.path.join(tmp_dir, "screw_export-5.3.iges"), 3.78827401651e-06, 10 ** -17) testExport("IGS-5.3", "IGES-5.3", os.path.join(tmp_dir, "screw_export-5.3.igs"), 3.78827401651e-06, 10 ** -17) #========================================================================= diff --git a/src/ExchangePlugin/Test/TestImport.py b/src/ExchangePlugin/Test/TestImport.py index 587fa615a..66ebe0dca 100644 --- a/src/ExchangePlugin/Test/TestImport.py +++ b/src/ExchangePlugin/Test/TestImport.py @@ -147,9 +147,9 @@ if __name__ == '__main__': # Create a shape imported from IGES #========================================================================= shape_path = getShapePath("Iges/bearing.igs") - testImport("IGES", shape_path, 6.86970803067e-14, 10 ** -25) + testImport("IGES", shape_path, 1.3407098545036494e-08, 10 ** -25) shape_path = shutil.copyfile(shape_path, os.path.join(tmp_dir, "bearing.iges")) - testImport("IGS", shape_path, 6.86970803067e-14, 10 ** -25) + testImport("IGS", shape_path, 1.3407098545036494e-08, 10 ** -25) #========================================================================= # Create a shape imported from XAO diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py index 1b3d19118..89e30e116 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py @@ -49,7 +49,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [26]) -model.testResultsVolumes(Partition_1, [61838.592736754246288910508155823]) +model.testResultsVolumes(Partition_1, [58449.978430461182142607867717743]) # update extrusion and check partition Param_ExtrusionMin.setValue(-5) @@ -60,7 +60,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [3]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [23]) -model.testResultsVolumes(Partition_1, [60961.060159030253998935222625732]) +model.testResultsVolumes(Partition_1, [58449.978432491210696753114461899]) # change radius of a circle and check partition Param_Radius.setValue(50) @@ -70,7 +70,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [3]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [23]) -model.testResultsVolumes(Partition_1, [83608.865629965730477124452590942]) +model.testResultsVolumes(Partition_1, [81554.943249323987402021884918213]) # check naming model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py index a4b56d3c8..2f910a3c3 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py @@ -49,7 +49,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [3]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [22]) -model.testResultsVolumes(Partition_1, [61945.742345225989993195980787277]) +model.testResultsVolumes(Partition_1, [58449.978430083079729229211807251]) # update extrusion and check partition Param_ExtrusionMin.setValue(-5) @@ -60,7 +60,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [3]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [21]) -model.testResultsVolumes(Partition_1, [60999.340090954778133891522884369]) +model.testResultsVolumes(Partition_1, [58449.978432399570010602474212646]) # change radius of a circle and check partition Param_Radius.setValue(50) @@ -70,7 +70,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [3]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [21]) -model.testResultsVolumes(Partition_1, [83593.613567417080048471689224243]) +model.testResultsVolumes(Partition_1, [81554.943249112344346940517425537]) # check naming model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py index 523cd6af6..a1f82012b 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py @@ -49,7 +49,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [24]) -model.testResultsVolumes(Partition_1, [61517.614401630766224116086959839]) +model.testResultsVolumes(Partition_1, [58449.978431462892331182956695557]) # update extrusion and check partition Param_ExtrusionMin.setValue(-5) @@ -60,7 +60,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [24]) -model.testResultsVolumes(Partition_1, [60866.055096277588745579123497009]) +model.testResultsVolumes(Partition_1, [58449.978433344353106804192066193]) # change radius of a circle and check partition Param_Radius.setValue(50) @@ -70,7 +70,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [24]) -model.testResultsVolumes(Partition_1, [83526.053426235652295872569084167]) +model.testResultsVolumes(Partition_1, [81554.943249494404881261289119720]) # check naming model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py index 0884d51f4..6bec410de 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py @@ -50,7 +50,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [27]) -model.testResultsVolumes(Partition_1, [61887.558125601033680140972137451]) +model.testResultsVolumes(Partition_1, [58449.978429485141532495617866516]) # update extrusion and check partition Param_ExtrusionMin.setValue(-5) @@ -61,7 +61,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [25]) -model.testResultsVolumes(Partition_1, [60989.714891709969379007816314697]) +model.testResultsVolumes(Partition_1, [58449.978433180862339213490486145]) # change radius of a circle and check partition Param_Radius.setValue(50) @@ -71,7 +71,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [25]) -model.testResultsVolumes(Partition_1, [83670.313521821837639436125755310]) +model.testResultsVolumes(Partition_1, [81554.943249094052589498460292816]) # check naming model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py index ce525b98b..29a2dcb1a 100644 --- a/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py +++ b/src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py @@ -50,7 +50,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [5]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [29]) -model.testResultsVolumes(Partition_1, [61804.7209520386313670314848423]) +model.testResultsVolumes(Partition_1, [58449.978429877664893865585327148]) # update extrusion and check partition Param_ExtrusionMin.setValue(-5) @@ -61,7 +61,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [25]) -model.testResultsVolumes(Partition_1, [60965.634801387262996286153793335]) +model.testResultsVolumes(Partition_1, [58449.978433183350716717541217804]) # change radius of a circle and check partition Param_Radius.setValue(50) @@ -71,7 +71,7 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [4]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [25]) -model.testResultsVolumes(Partition_1, [83661.21013607898203190416097641]) +model.testResultsVolumes(Partition_1, [81554.943249191215727478265762329]) # check naming model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc) -- 2.39.2