0031685: Data Exchange, STEPCAFControl_Reader - NULL dereference on translating PLACE...
[occt.git] / tests / bugs / step / bug31685_3
diff --git a/tests/bugs/step/bug31685_3 b/tests/bugs/step/bug31685_3
new file mode 100644 (file)
index 0000000..97ed381
--- /dev/null
@@ -0,0 +1,44 @@
+puts "==================================================="
+puts " 0031685: Data Exchange, STEPCAFControl_Reader - NULL dereference on translating PLACED_DATUM_TARGET_FEATURE "
+puts "==================================================="
+puts ""
+
+pload DCAF
+
+# Read file
+ReadStep D [locate_data_file bug31685_3.stp] 
+XGetOneShape res D
+
+# Checking
+checkshape res f
+set dump [XDumpNbDGTs D f]
+set info "
+
+ NbOfDimensions          : 60
+  NbOfDimensionalSize    : 20
+  NbOfDimensionalLocation: 2
+  NbOfAngular            : 0
+  NbOfWithPath           : 0
+  NbOfCommonLabels       : 1
+ NbOfTolerances          : 38
+  NbOfGTWithModifiers    : 3
+  NbOfGTWithMaxTolerance : 0
+  NbOfGTWithDatums       : 35
+ NbOfDatumFeature        : 15
+ NbOfAttachedDatum       : 109
+ NbOfDatumTarget         : 4
+"
+set isOK 1;
+set nb_ref [llength $dump]
+for { set i 0 } { $i < $nb_ref } { incr i } {
+  set refstr [lindex $info $i]
+  set curstr [lindex $dump $i]
+  if {[string equal $refstr $curstr] == 0} {
+    set isOK 0
+  }
+}
+if {$isOK == 0} {
+  puts "Error: wrong translate DGT"
+}
+
+Close D
\ No newline at end of file