diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-03-24 15:52:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-03-24 15:52:42 (GMT) |
commit | e30a832a0e2040dd682f2e77c6d26043e0829d80 (patch) | |
tree | 422f4d2326d1d9efae447878c3a465fe4c449779 /tests | |
parent | 1749f80a0818eb09d3657e5d1c9038c031d9e30e (diff) | |
download | tcl-e30a832a0e2040dd682f2e77c6d26043e0829d80.zip tcl-e30a832a0e2040dd682f2e77c6d26043e0829d80.tar.gz tcl-e30a832a0e2040dd682f2e77c6d26043e0829d80.tar.bz2 |
Supply more C99-compatible (and MSVC) format options: '%p' for pointers, 'z'/'j'/'I' for size_t/intptr_diff, 'j'/'q' for long long. Also add "I32" froom MSVC.
Remove TCL_LL_MODIFIER specified as "L" for Borland: This must be wrong as "L" is meant for long double. Just assume that later Borland compilers are MSVC-compatible.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/util.test | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/tests/util.test b/tests/util.test index 1a3eecb..22d120b 100644 --- a/tests/util.test +++ b/tests/util.test @@ -4027,21 +4027,45 @@ test util-18.2 {Tcl_ObjPrintf} {testprint} { } {9223372036854775807} test util-18.3 {Tcl_ObjPrintf} {testprint} { - testprint %Ld [expr 2**63-1] + testprint %qd [expr 2**63-1] } {9223372036854775807} test util-18.4 {Tcl_ObjPrintf} {testprint} { + testprint %jd [expr 2**63-1] +} {9223372036854775807} + +test util-18.5 {Tcl_ObjPrintf} {testprint} { testprint %lld [expr -2**63] } {-9223372036854775808} -test util-18.5 {Tcl_ObjPrintf} {testprint} { +test util-18.6 {Tcl_ObjPrintf} {testprint} { testprint %I64d [expr -2**63] } {-9223372036854775808} -test util-18.6 {Tcl_ObjPrintf} {testprint} { - testprint %Ld [expr -2**63] +test util-18.7 {Tcl_ObjPrintf} {testprint} { + testprint %qd [expr -2**63] } {-9223372036854775808} +test util-18.8 {Tcl_ObjPrintf} {testprint} { + testprint %jd [expr -2**63] +} {-9223372036854775808} + +test util-18.9 {Tcl_ObjPrintf} {testprint} { + testprint "%I64d %I32d" [expr -2**63+2] +} {-9223372036854775806 2} + +test util-18.10 {Tcl_ObjPrintf} {testprint} { + testprint "%I64d %p" 65535 +} {65535 0xffff} + +test util-18.11 {Tcl_ObjPrintf} {testprint} { + testprint "%I64d %td" 65536 +} {65536 65536} + +test util-18.12 {Tcl_ObjPrintf} {testprint} { + testprint "%I64d %Id" 65537 +} {65537 65537} + set ::tcl_precision $saved_precision # cleanup |