0028204: TopoTools_ShapeSet::Dump() does not show flag Locked
authorski <ski@opencascade.com>
Thu, 22 Dec 2016 09:40:55 +0000 (12:40 +0300)
committerapn <apn@opencascade.com>
Thu, 22 Dec 2016 09:41:16 +0000 (12:41 +0300)
Corrected command dump to show flag Locked for shapes in DRAW.
Test case for issue CR28204
Updated test case.

src/TopTools/TopTools_ShapeSet.cxx
tests/bugs/moddata_2/bug6278
tests/bugs/moddata_3/bug28204 [new file with mode: 0644]

index 3e8bf4d..5630c5c 100644 (file)
@@ -380,7 +380,7 @@ void  TopTools_ShapeSet::Dump(Standard_OStream& OS)const
   OS << "\nDump of " << nbShapes << " TShapes";
   OS << "\n\n-----------------\n\n";
 
-  OS << "Flags : Free, Modified, Checked, Orientable, Closed, Infinite, Convex";
+  OS << "Flags : Free, Modified, Checked, Orientable, Closed, Infinite, Convex, Locked";
   OS << "\n\n";
   
   for (i = nbShapes; i >= 1; i--) {
@@ -399,6 +399,7 @@ void  TopTools_ShapeSet::Dump(Standard_OStream& OS)const
     OS << (S.Closed()     ? 1 : 0);
     OS << (S.Infinite()   ? 1 : 0);
     OS << (S.Convex()     ? 1 : 0);
+    OS << (S.Locked()     ? 1 : 0);
     OS << " " << (void*) &(*S.TShape()) <<"\n";
 
     // sub-shapes
index cd65e69..506e19f 100755 (executable)
@@ -24,36 +24,15 @@ if {[llength ${DumpList}] < 40} {
     puts $x
     puts $y
     puts $z
-    
-    set percent_max 0.1
-    
-    set x [lindex ${DumpList} 37]
-    set y [lindex ${DumpList} 38]
-    set z [lindex ${DumpList} 39]
-
-    set x [string range ${x} 0 end-1]
-    set y [string range ${y} 0 end-1]
 
     set good_x -32.3042674857046
     set good_y 20.0000000000001
     set good_z 0.
 
-    set Percent_x [expr abs(${x} - ${good_x}) / abs(${good_x}) * 100.]
-    set Percent_y [expr abs(${y} - ${good_y}) / abs(${good_y}) * 100.]
-    if {${z} == 0.} {
-        set Percent_z 0.
-    } else {
-        set Percent_z [expr abs(${good_z} - ${z}) / abs(${z}) * 100.]
-    }
-
-    if {${Percent_x} > ${percent_max}} {
-        puts "Faulty ${BugNumber}: bad value of x = ${x}"
-    }
-    if {${Percent_y} > ${percent_max}} {
-       puts "Faulty ${BugNumber}: bad value of y = ${y}"
-    }
-    if {${Percent_z} > ${percent_max}} {
-        puts "Faulty ${BugNumber}: bad value of z = ${z}"
+    checkreal "x" ${x} ${good_x} 0 0.001
+    checkreal "y" ${y} ${good_y} 0 0.001
+    if { ${z} != 0. } {
+        checkreal "z" ${z} ${good_z} 0 0.001
     }
 }
 
diff --git a/tests/bugs/moddata_3/bug28204 b/tests/bugs/moddata_3/bug28204
new file mode 100644 (file)
index 0000000..23908de
--- /dev/null
@@ -0,0 +1,17 @@
+puts "============"
+puts "CR28204"
+puts "==========="
+puts ""
+###############################################################################
+# TopoTools_ShapeSet::Dump() does not show flag Locked
+###############################################################################
+
+vertex v 0 0 0 
+setflags v locked
+set info [dump v]
+
+if { [regexp {Locked} ${info}] == 1 } {
+   puts "OK: Dump show flag Locked"
+} else {
+   puts "Error: Dump does not show flag Locked"
+}