summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-08-05 18:24:52 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-08-05 18:24:52 (GMT)
commitc411bb62c886240f5cbd8f59c5c3c8ff5c9f5754 (patch)
tree4ad7fbc0c3a19c3952527220252557dc1f0ac5a5 /tests
parent852db00065c8640e3bada1db0306dbaee830207c (diff)
downloadtcl-c411bb62c886240f5cbd8f59c5c3c8ff5c9f5754.zip
tcl-c411bb62c886240f5cbd8f59c5c3c8ff5c9f5754.tar.gz
tcl-c411bb62c886240f5cbd8f59c5c3c8ff5c9f5754.tar.bz2
Cleaned up [binary scan] testing for NaN [Bug 1246264]
Diffstat (limited to 'tests')
-rw-r--r--tests/binary.test35
1 files changed, 16 insertions, 19 deletions
diff --git a/tests/binary.test b/tests/binary.test
index fb934d8..d0491ff 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: binary.test,v 1.20 2005/05/10 20:17:43 kennykb Exp $
+# RCS: @(#) $Id: binary.test,v 1.21 2005/08/05 18:25:00 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -1384,24 +1384,21 @@ test binary-39.5 {ScanNumber: sign extension} {
list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 I5 arg1] $arg1
} {1 {16843010 -2130640639 25297153 16876033 16843137}}
-test binary-40.1 {ScanNumber: floating point overflow} {nonPortable bigEndian} {
- catch {unset arg1}
- list [binary scan \xff\xff\xff\xff f1 arg1] $arg1
-} {1 -NaN}
-test binary-40.3 {ScanNumber: floating point overflow} {littleEndian win} {
- catch {unset arg1}
- set result [binary scan \xff\xff\xff\xff f1 arg1]
- lappend result [regexp -nocase NaN $arg1]
-} {1 1}
-test binary-40.4 {ScanNumber: floating point overflow} {nonPortable bigEndian} {
- catch {unset arg1}
- list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1
-} {1 -NaN}
-test binary-40.6 {ScanNumber: floating point overflow} {littleEndian win} {
- catch {unset arg1}
- set result [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1]
- lappend result [regexp -nocase NaN $arg1]
-} {1 1}
+test binary-40.3 {ScanNumber: NaN} \
+ -body {
+ catch {unset arg1}
+ list [binary scan \xff\xff\xff\xff f1 arg1] $arg1
+ } \
+ -match glob \
+ -result {1 -NaN*}
+
+test binary-40.4 {ScanNumber: NaN} \
+ -body {
+ catch {unset arg1}
+ list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d arg1] $arg1
+ } \
+ -match glob \
+ -result {1 -NaN*}
test binary-41.1 {ScanNumber: word alignment} {
catch {unset arg1; unset arg2}