mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-16 05:04:11 +08:00
Added DRAW command dlocale to set and query current locale of the C subsystem Equivalents of C functions working with conversions of strings to/from reals added in Standard_CString, providing locale-independent behavior (using always "C" locale) In DRAW packages, calls to atof() and atoi() are replaced by direct calls to Draw::Atof() and Draw::Atoi(), respectively, instead of substituting by #define Use of atof(), strtod(), and *scanf() involving floating point conversions in OCCT code replaced by locale-independent Atof() and Strtod() Calls to sprintf() involving floating point in OCCT code are replaced by call to locale-independent Sprintf(), except a few places where converted strings are used immediately for display in the 3d viewer Changes of global locale are eliminated throughout OCCT code Proposed correction for GNU libC where v*printf_l functions are absent Added test case (bugs xde bug22898) for data exchange operations with non-standard locale Use xlocale on Mac OS X and within glibc Corrected strtod_l wrapper Generate error rather than warning Introduce Standard_CLocaleSentry replacement for removed OSD_Localizer Standard_CLocaleSentry - copy locale string Standard_CLocaleSentry - use _configthreadlocale on Windows Standard_CLocaleSentry::GetCLocale() - return locale_t rather than void* Corrected misprint in ~Standard_CLocaleSentry() Use French locale in bug22898 test case Mark test case as skipped if locale is unavailable on tested system. Use fr_FR locale for tests on Mac OS X
54 lines
1.2 KiB
Plaintext
54 lines
1.2 KiB
Plaintext
# Test for issue #22898 and other functionality that can be affected by locale.
|
|
# Just run multiple conversions of the shape to and from diferent formats and
|
|
# check that the result is good shape with expected area
|
|
|
|
set anOS $tcl_platform(os)
|
|
if { ${anOS} == "Darwin" } {
|
|
dlocale LC_ALL fr_FR
|
|
} else {
|
|
dlocale LC_ALL French
|
|
}
|
|
|
|
pload MODELING
|
|
pload XSTEP
|
|
|
|
# original shape
|
|
restore [locate_data_file hammer.brep] hammer
|
|
checkshape hammer
|
|
tolerance hammer
|
|
checkarea hammer 3.978e8 1e6 0.001
|
|
|
|
# BREP
|
|
save hammer $imagedir/hammer.brep
|
|
restore $imagedir/hammer.brep brep
|
|
checkshape brep
|
|
tolerance brep
|
|
checkarea brep 3.978e8 1e6 0.001
|
|
|
|
# IGES
|
|
brepiges hammer $imagedir/hammer.igs
|
|
igesbrep $imagedir/hammer.igs iges *
|
|
checkshape iges
|
|
tolerance iges
|
|
checkarea iges 3.978e8 1e6 0.001
|
|
|
|
# STEP
|
|
stepwrite a hammer $imagedir/hammer.stp
|
|
stepread $imagedir/hammer.stp step *
|
|
checkshape step_1
|
|
tolerance step_1
|
|
checkarea step_1 3.978e8 1e6 0.001
|
|
|
|
# STL
|
|
writestl hammer $imagedir/hammer.stl
|
|
readstl stl $imagedir/hammer.stl
|
|
checkshape stl
|
|
tolerance stl
|
|
checkarea stl 3.978e8 1e6 0.001
|
|
|
|
# VRML: reading does not work regardless of locale...
|
|
writevrml hammer $imagedir/hammer.vrml
|
|
#loadvrml vrml $imagedir/hammer.vrml
|
|
#checkshape vrml
|
|
#tolerance vrml
|