0027970: Improvement of standard attributes usability - containers.
[occt.git] / tests / caf / basic / W10
diff --git a/tests/caf/basic/W10 b/tests/caf/basic/W10
new file mode 100644 (file)
index 0000000..9d91cd5
--- /dev/null
@@ -0,0 +1,50 @@
+#INTERFACE CAF
+# Basic attributes
+# Std documents
+#
+# Testing support of std format: reading standard attribute RealList
+#
+# Testing command:   Open, GetRealList.
+#
+
+puts "caf001-W10"
+set QA_DUP 0
+
+# Add an attribute to a data framework
+set aSetAttr1 {1.1 1.2 1.3 1.4 1.5}
+set aLabel 0:1
+set aFile [locate_data_file caf001_realList.std]
+#Open a document
+Open ${aFile} D
+
+# Get a value of the attribute
+set IsGood 1
+set aMessage1 "Add TDataStd_RealList attribute: Error"
+set aGetAttr1 [GetRealList D ${aLabel}]
+set aLenRead [llength ${aGetAttr1}]
+set aLenSet [llength ${aSetAttr1}]
+
+if { ${aLenRead} != ${aLenSet} } {
+   set IsGood 0
+   puts "aLenRead=${aLenRead}"
+   puts ${aMessage1}
+}
+
+if { ${IsGood} == 0}  return
+
+for {set i 0} {$i < $aLenRead} {incr i} {
+  set aGetAttr11 [lindex ${aGetAttr1} $i]
+  set aGetAttr21 [lindex ${aSetAttr1} $i]
+  if { ${aGetAttr11} != ${aGetAttr21} } {
+     set IsGood 0;puts "i=${i}"
+     puts "aGetAttr11=${aGetAttr11}"
+     puts "aGetAttr21=${aGetAttr21}"
+     break
+     }
+}
+
+if { ${IsGood} == 0} {
+  puts ${aMessage1}
+} else {
+  puts "Add TDataStd_RealList attribute: OK"
+}