RegressionTests__CRCTests.st
changeset 2106 288fa2469be2
parent 2098 8cf7cbaf99fb
child 2107 c318ea211c64
--- a/RegressionTests__CRCTests.st	Sat Mar 16 23:27:39 2019 +0100
+++ b/RegressionTests__CRCTests.st	Sun Mar 17 01:12:49 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/regression' }"
 
 "{ NameSpace: RegressionTests }"
@@ -41,8 +43,8 @@
     "Created: / 16-03-2019 / 23:22:34 / Claus Gittinger"
 !
 
-test01_crc32c
-    "the default ccitt crc32"
+test02_crc32c
+    "the Castagnoli crc32"
     
     self assert:(CRC32Stream newCrc32c hashValueOf:'') = 0.
     self assert:(CRC32Stream newCrc32c hashValueOf:'a') = 16rC1D04330.
@@ -51,7 +53,19 @@
     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"
+    "Created: / 16-03-2019 / 23:39:52 / Claus Gittinger"
+!
+
+test03_crc16
+    "the default ccitt crc16"
+    
+    CRC16Stream flushCrcTables.
+    "/ CRCStream flushCrcTables.
+    "/ CRC32Stream flushCrcTables.
+    self assert:(CRC16Stream new hashValueOf:#[16rFC 5 16r11]) = 16r2756.
+    self assert:(CRC16Stream new hashValueOf:'123456789') = 16r8921.
+
+    "Created: / 16-03-2019 / 23:40:26 / Claus Gittinger"
 ! !
 
 !CRCTests class methodsFor:'documentation'!