]> OCCT Git - occt-copy.git/commitdiff
Test for 0024251: Command checkshape does not report a problem on first call after... CR24251
authorapv <apv@opencascade.com>
Tue, 25 Jul 2017 15:22:09 +0000 (18:22 +0300)
committerapv <apv@opencascade.com>
Tue, 25 Jul 2017 15:22:09 +0000 (18:22 +0300)
tests/bugs/modalg_7/bug24251 [new file with mode: 0644]

diff --git a/tests/bugs/modalg_7/bug24251 b/tests/bugs/modalg_7/bug24251
new file mode 100644 (file)
index 0000000..d679cdf
--- /dev/null
@@ -0,0 +1,38 @@
+puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_"
+
+puts "TODO OCC24251 ALL: ERROR: OCC24251 is reproduced."
+
+puts "========"
+puts "OCC24251"
+puts "========"
+puts ""
+#############################################################################
+# Command checkshape does not report a problem on first call after fixshape
+#############################################################################
+
+restore [locate_data_file bug24899_TheHull.brep] r0
+
+# First usage of checkshape command for r0
+set bug_info_initial [checkshape r0]
+
+# Calculate number of problematic sub-shapes before using fixshape command
+set bug_info_initial [lindex $bug_info_initial [expr {[llength $bug_info_initial] - 1}]]
+set bug_info_initial [string trim [string range $bug_info_initial [expr {[string last "_" $bug_info_initial] + 1}] [expr {[string length $bug_info_initial] - 1}]]]
+
+fixshape r r0
+
+# Second usage of checkshape command for r0
+set bug_info_final [checkshape r0]
+
+# ERROR if "This shape seems to be valid" after checkshape command
+if {$bug_info_final == "This shape seems to be valid"} {
+  puts "ERROR: OCC24251 is reproduced. Second usage of checkshape command does not show problems"
+} else {
+# Calculate number of problematic sub-shapes on after using fixshape command
+  set bug_info_final [lindex $bug_info_final [expr {[llength $bug_info_final] - 1}]]
+  set bug_info_final [string trim [string range $bug_info_final [expr {[string last "_" $bug_info_final] + 1}] [expr {[string length $bug_info_final] - 1}]]]
+# ERROR if result of first usage checkshape command is different from the second usage
+  if {$bug_info_final != $bug_info_initial} {
+    puts "ERROR: OCC24251 is reproduced. Second usage of checkshape command shows $bug_info_final problems, but first usage shows $bug_info_initial"
+  }
+}