From 973f1c39aca295b43eca6650bb72f734b334d30b Mon Sep 17 00:00:00 2001 From: pkv Date: Mon, 15 Apr 2013 18:22:32 +0400 Subject: [PATCH] 0023891: Function fsameparameter throws an exception. Added test cases bugs modalg_5/bug23891_1/bug23891_2/bug23891_3/bug23891_4 --- src/BRepLib/BRepLib.cxx | 4 ++-- tests/bugs/modalg_5/bug23891_1 | 17 +++++++++++++++++ tests/bugs/modalg_5/bug23891_2 | 17 +++++++++++++++++ tests/bugs/modalg_5/bug23891_3 | 17 +++++++++++++++++ tests/bugs/modalg_5/bug23891_4 | 17 +++++++++++++++++ 5 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/modalg_5/bug23891_1 create mode 100644 tests/bugs/modalg_5/bug23891_2 create mode 100644 tests/bugs/modalg_5/bug23891_3 create mode 100644 tests/bugs/modalg_5/bug23891_4 diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index 22ddf03759..a397553197 100755 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -1040,8 +1040,8 @@ void BRepLib::SameParameter(const TopoDS_Edge& AnEdge, } // Eval tol2d to compute SameRange - Standard_Real UResol = GAS.UResolution(Tolerance); - Standard_Real VResol = GAS.VResolution(Tolerance); + Standard_Real UResol = Max(GAS.UResolution(Tolerance), Precision::PConfusion()); + Standard_Real VResol = Max(GAS.VResolution(Tolerance), Precision::PConfusion()); Standard_Real Tol2d = Min(UResol, VResol); for(Standard_Integer i = 0; i < 2; i++){ Handle(Geom2d_Curve) curPC = PC[i]; diff --git a/tests/bugs/modalg_5/bug23891_1 b/tests/bugs/modalg_5/bug23891_1 new file mode 100644 index 0000000000..0300733f0c --- /dev/null +++ b/tests/bugs/modalg_5/bug23891_1 @@ -0,0 +1,17 @@ +puts "========================" +puts "OCC23891" +puts "========================" +puts "" +################################################# +# Function fsameparameter throws an exception +################################################# + +restore [locate_data_file bug23891_fsp6] result +fit +if [catch {fsameparameter result} catch_result] { + puts "Faulty : function fsameparameter throws an exception" +} else { + puts "OK : function fsameparameter works properly" +} + +set 2dviewer 0 diff --git a/tests/bugs/modalg_5/bug23891_2 b/tests/bugs/modalg_5/bug23891_2 new file mode 100644 index 0000000000..eb7753785c --- /dev/null +++ b/tests/bugs/modalg_5/bug23891_2 @@ -0,0 +1,17 @@ +puts "========================" +puts "OCC23891" +puts "========================" +puts "" +################################################# +# Function fsameparameter throws an exception +################################################# + +restore [locate_data_file bug23891_fsp7] result +fit +if [catch {fsameparameter result} catch_result] { + puts "Faulty : function fsameparameter throws an exception" +} else { + puts "OK : function fsameparameter works properly" +} + +set 2dviewer 0 diff --git a/tests/bugs/modalg_5/bug23891_3 b/tests/bugs/modalg_5/bug23891_3 new file mode 100644 index 0000000000..31dc013ac1 --- /dev/null +++ b/tests/bugs/modalg_5/bug23891_3 @@ -0,0 +1,17 @@ +puts "========================" +puts "OCC23891" +puts "========================" +puts "" +################################################# +# Function fsameparameter throws an exception +################################################# + +restore [locate_data_file bug23891_fsp8] result +fit +if [catch {fsameparameter result} catch_result] { + puts "Faulty : function fsameparameter throws an exception" +} else { + puts "OK : function fsameparameter works properly" +} + +set 2dviewer 0 diff --git a/tests/bugs/modalg_5/bug23891_4 b/tests/bugs/modalg_5/bug23891_4 new file mode 100644 index 0000000000..6e5adbc998 --- /dev/null +++ b/tests/bugs/modalg_5/bug23891_4 @@ -0,0 +1,17 @@ +puts "========================" +puts "OCC23891" +puts "========================" +puts "" +################################################# +# Function fsameparameter throws an exception +################################################# + +restore [locate_data_file bug23891_fsp9] result +fit +if [catch {fsameparameter result} catch_result] { + puts "Faulty : function fsameparameter throws an exception" +} else { + puts "OK : function fsameparameter works properly" +} + +set 2dviewer 0 -- 2.20.1