1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/tests/bugs/caf/bug24925
Roman Lygin b6c0b841ec 0024925: Enabling OCAF persistence without setting environment variables
Add test case bugs/caf/bug24925
Merging with current master IR-2014-07-03
2014-07-10 14:48:55 +04:00

39 lines
1.2 KiB
Plaintext

puts "==========="
puts "OCC24925 Enabling OCAF persistence without setting environment variables"
puts "==========="
pload QAcommands
set THE_PLUGIN "TKXml"
set THE_SAVE_DRIVER "03a56820-8269-11d5-aab2-0050044b1af1"
set THE_LOAD_DRIVER "03a56822-8269-11d5-aab2-0050044b1af1"
set aFileName "$imagedir/${casename}_doc.xml"
if { [file exists "$aFileName"] == 1} {
file delete $aFileName
}
# corrupt environment variable to Plugin file
set anEnvOld [dgetenv CSF_PluginDefaults]
dsetenv "CSF_PluginDefaults"
set anEnvNow [dgetenv CSF_PluginDefaults]
puts "Unset environment variable CSF_PluginDefaults (old='${anEnvOld}', new='${anEnvNow}')"
OCC24925 "$aFileName" $THE_PLUGIN $THE_SAVE_DRIVER $THE_LOAD_DRIVER
if { [file isfile "$aFileName"] == 1} {
set aFile [open "$aFileName" r]
set aFileData [read $aFile]
close $aFile
if { [string first "My Proprietary Format" "$aFileData"] == -1} {
puts "Error: XML file does not contain 'My Proprietary Format'!"
}
if { [string first "QABugs_19.cxx" "$aFileData"] == -1} {
puts "Error: XML file does not contain 'QABugs_19.cxx'!"
}
} else {
puts "Error: file is not created!"
}
#dsetenv "CSF_PluginDefaults" "anEnvOld"