initial checkin
authorClaus Gittinger <cg@exept.de>
Fri, 11 Apr 2014 00:30:25 +0200
changeset 1113 7e24c992441b
parent 1112 f462798b6a1d
child 1114 197d2abe6042
initial checkin
RegressionTests__UninterpretedBytesTest.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RegressionTests__UninterpretedBytesTest.st	Fri Apr 11 00:30:25 2014 +0200
@@ -0,0 +1,53 @@
+"{ Package: 'exept:regression' }"
+
+"{ NameSpace: RegressionTests }"
+
+TestCase subclass:#UninterpretedBytesTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'tests-Regression-Collections'
+!
+
+
+!UninterpretedBytesTest methodsFor:'tests'!
+
+testFloatAccess
+    |bytes|
+
+    bytes := ByteArray new:4.
+    bytes floatAt:1 put:1.234.
+    self assert:(bytes = #[182 243 157 63]).
+
+    bytes floatAt:1 put:2.345 asShortFloat.
+    self assert:(bytes = #[123 20 22 64]).
+
+    bytes floatAt:1 put:345.
+    self assert:(bytes = #[0 128 172 67]).
+
+
+    bytes := ByteArray new:8.
+    bytes doubleAt:1 put:1.234.
+    self assert:(bytes = #[88 57 180 200 118 190 243 63]).
+
+    bytes doubleAt:1 put:2.345 asShortFloat.
+    self assert:(bytes = #[0 0 0 96 143 194 2 64]).
+
+    bytes doubleAt:1 put:345.
+    self assert:(bytes = #[0 0 0 0 0 144 117 64]).
+
+    "
+     self run:#testFloatAccess
+    "
+! !
+
+!UninterpretedBytesTest class methodsFor:'documentation'!
+
+version
+    ^ '$Header$'
+!
+
+version_CVS
+    ^ '$Header$'
+! !
+