initial checkin
authorClaus Gittinger <cg@exept.de>
Sat, 16 Mar 2019 23:26:47 +0100
changeset 2098 8cf7cbaf99fb
parent 2097 f32e782522d0
child 2099 c0402d1db247
initial checkin
RegressionTests__CRCTests.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RegressionTests__CRCTests.st	Sat Mar 16 23:26:47 2019 +0100
@@ -0,0 +1,62 @@
+"{ Package: 'stx:goodies/regression' }"
+
+"{ NameSpace: RegressionTests }"
+
+TestCase subclass:#CRCTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'tests-Regression-Streams'
+!
+
+!CRCTests class methodsFor:'documentation'!
+
+documentation
+"
+    documentation to be added.
+
+    [author:]
+        Claus Gittinger
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+! !
+
+!CRCTests methodsFor:'tests'!
+
+test01_crc32
+    "the default ccitt crc32"
+    
+    self assert:(CRC32Stream new hashValueOf:'') = 0.
+    self assert:(CRC32Stream new hashValueOf:'resume') = 16r60C1D0A0.
+    self assert:(CRC32Stream new hashValueOf:#[1 2 3 4 5 6 7]) = 16r70E46888.
+    self assert:(CRC32Stream new hashValueOf:(ByteArray new:40 withAll:16rFF)) = 16r8CD04C73.
+    self assert:(CRC32Stream new hashValueOf:'123456789') = 16rCBF43926.
+
+    "Created: / 16-03-2019 / 23:22:34 / Claus Gittinger"
+!
+
+test01_crc32c
+    "the default ccitt crc32"
+    
+    self assert:(CRC32Stream newCrc32c hashValueOf:'') = 0.
+    self assert:(CRC32Stream newCrc32c hashValueOf:'a') = 16rC1D04330.
+    self assert:(CRC32Stream newCrc32c hashValueOf:'123456789') = 16rE3069283.
+    self assert:(CRC32Stream newCrc32c hashValueOf:(ByteArray new:32 withAll:0)) = 16r8A9136AA.
+    self assert:(CRC32Stream newCrc32c hashValueOf:(ByteArray new:32 withAll:16rFF)) = 16r62a8ab43.
+    self assert:(CRC32Stream newCrc32c hashValueOf:((0 to:31) asByteArray)) = 16r46dd794e.
+
+    "Created: / 16-03-2019 / 23:26:18 / Claus Gittinger"
+! !
+
+!CRCTests class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header$'
+! !
+