Correction of testing case for issue 24374
[occt.git] / tests / bugs / caf / bug425
1 puts "==========="
2 puts "OCC425"
3 puts "OCC414"
4 puts "==========="
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
11 set IsGood 1
12
13 NewDocument D MDTV-Standard
14 UndoLimit D 10
15
16 # Add an attribute to a data framework
17 set aSetAttr1 ""
18 set aLabel 0:2
19 Label D ${aLabel}
20 SetName D ${aLabel} ${aSetAttr1}
21
22 # Close/Open the transaction
23 NewCommand D
24
25 # Save the document
26 set aFile ${imagedir}/OCC425.std
27 catch {file delete ${aFile}}
28 SaveAs D ${aFile}
29 if { ![file exists ${aFile}] } {
30     puts "There is not ${aFile} file; SaveAs command: Error"
31     set IsGood 0
32 }
33 catch {exec chmod 777 ${aFile}}
34
35 # Restore the document
36 Close D
37 Open ${aFile} DD
38
39 # Get a value of the attribute
40 set aGetAttr3 ""
41 set IsDone [catch {set aGetAttr3 [GetName DD ${aLabel}]} aResult]
42 if { ${IsDone} != 0 } {
43     puts "OCC425: Error"
44     set IsGood 0
45 }
46 if { ${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
52 if { ${IsGood} != 1 } {
53     puts "OCC425: Error"
54 }
55