1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
ski 1951a27c98 0024863: CLang warnings -Wint-to-void-pointer-cast
Warning was fixed.

Remarks were applied.

- class VMap in Draw was removed
- NCollection_DataMap is used to store objects
- name of object is used to associate Tcl variable with the object
- creation and changing of objects are correclty handled

Redundant casts were removed.

Initial value is restored if variable is protected.
Tests for bug  were added.

Some test cases and tcl command "save" were improved.

Useless using of upvar was removed.
2014-08-07 14:33:28 +04:00

73 lines
1.6 KiB
Plaintext
Executable File

pload TOPTEST
pload DCAF
cpulimit 300
set ValidatorCheck 0
if { [info exists env(CSF_ValidatorPath)] != 0 } {
if {[file exists $env(CSF_ValidatorPath)]} {
set ValidatorCheck 1
set Validator $env(CSF_ValidatorPath)
}
}
if { [info exists imagedir] == 0 } {
set imagedir .
}
if { [info exists test_image ] == 0 } {
set test_image photo
}
set WorkDirectory $imagedir
set os "ALL"
if {[array get env os_type] != ""} {
set os $env(os_type)
}
if { [regexp "indows" $os] } {
if {[regexp -nocase {jdk} $env(PATH)] || [regexp -nocase {java} $env(PATH)]} {
set Java "java"
} else {
puts "Warning: environment variable PATH doesn't contain path to Java"
}
} else {
catch {set Java $env(JAVAHOME)/bin/java}
}
set SchemaFile ""
proc SaveToFile { aD aFile } {
upvar $aD D
global FileSuffix ValidatorCheck
catch {[file delete ${aFile}]}
SaveAs $D $aFile
if { [file exists $aFile] } {
if { $FileSuffix == "xml" && $ValidatorCheck} {
ValidateXml $aFile
} else {
puts "Validation of XML file by XSD schema is not provided."
}
} else {
puts "Error : There is no ${aFile} file"
}
catch {[file attributes ${aFile} -permissions 0777]}
}
proc ValidateXml { aFile } {
global Validator Java SchemaFile
if { ![info exists Java] } {
puts "Error : Java is not exists"
return
}
set isValidInfo ""
set ValCommand "exec $Java -jar $Validator $SchemaFile ${aFile}"
set isValid [catch {set isValidInfo [eval $ValCommand]}]
puts $isValidInfo
if { ![regexp "the document is valid" ${isValidInfo}] } {
puts "Error : File is not valid"
}
}