Adding test cases from grid chl
[occt.git] / tests / bugs / caf / bug425
CommitLineData
a87752f3 1puts "==========="
2puts "OCC425"
3puts "OCC414"
4puts "==========="
5######################################################
6# Exception on attemp to save a document that contains empty TDataStd_Name
7######################################################
8# Crash on NT during document saving (SAM1344-#2153)
9######################################################
10
11set IsGood 1
12
13NewDocument D MDTV-Standard
14UndoLimit D 10
15
16# Add an attribute to a data framework
17set aSetAttr1 ""
18set aLabel 0:2
19Label D ${aLabel}
20SetName D ${aLabel} ${aSetAttr1}
21
22# Close/Open the transaction
23NewCommand D
24
25# Save the document
26set aFile ${imagedir}/OCC425.std
27catch {file delete ${aFile}}
28SaveAs D ${aFile}
29if { ![file exists ${aFile}] } {
30 puts "There is not ${aFile} file; SaveAs command: Error"
31 set IsGood 0
32}
33catch {exec chmod 777 ${aFile}}
34
35# Restore the document
36Close D
37Open ${aFile} DD
38
39# Get a value of the attribute
40set aGetAttr3 ""
41set IsDone [catch {set aGetAttr3 [GetName DD ${aLabel}]} aResult]
42if { ${IsDone} != 0 } {
43 puts "OCC425: Error"
44 set IsGood 0
45}
46if { ${aSetAttr1}!=${aGetAttr3} } {
47 puts "aSetAttr1=${aSetAttr1} aGetAttr3=${aGetAttr3}"
48 puts "Get a value of TDataStd_Name attribute from restoring document: Error"
49 set IsGood 0
50}
51
52if { ${IsGood} != 1 } {
53 puts "OCC425: Error"
54}
55