puts "==========="
puts "OCC425"
puts "OCC414"
puts "==========="
######################################################
# Exception on attempt to save a document that contains empty TDataStd_Name
######################################################
# Crash on NT during document saving (SAM1344-#2153)
######################################################

set IsGood 1

NewDocument D BinOcaf
UndoLimit D 10

# Add an attribute to a data framework
set aSetAttr1 ""
set aLabel 0:2
Label D ${aLabel}
SetName D ${aLabel} ${aSetAttr1}

# Close/Open the transaction
NewCommand D

# Save the document
set aFile ${imagedir}/${casename}.cbf
SaveAs D ${aFile}
if { ![file exists ${aFile}] } {
    puts "There is not ${aFile} file; SaveAs command: Error"
    set IsGood 0
}

# Restore the document
Close D
Open ${aFile} DD
file delete -force ${aFile}

# Get a value of the attribute
set aGetAttr3 ""
set IsDone [catch {set aGetAttr3 [GetName DD ${aLabel}]} aResult]
if { ${IsDone} != 0 } {
    puts "OCC425: Error"
    set IsGood 0
}
if { ${aSetAttr1}!=${aGetAttr3} } {
    puts "aSetAttr1=${aSetAttr1} aGetAttr3=${aGetAttr3}"
    puts "Get a value of TDataStd_Name attribute from restoring document: Error"
    set IsGood 0
}

if { ${IsGood} != 1 } {
    puts "OCC425: Error"
}

