#FEATURE by Stefan Reise
class: RegressionTests::WebSocketTest
removed:
#byteArray500
#data500
#testCommunication100WithMasking
#testCommunication100WithoutMasking
#testCommunication500
#testCommunicationByteArray500
#testMask500
#testMask500Speed
category of:
#testCommunication100Speed
#testMask100Speed
#testParallelSocketWrite
class: WebSocketTest
changed:
#testCommunicationFilename
#testParallelSocketWrite
"{ Encoding: utf8 }"
"{ Package: 'stx:goodies/regression' }"
"{ NameSpace: RegressionTests }"
TestCase subclass:#EncoderTests
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'tests-Regression-Collections'
!
!EncoderTests class methodsFor:'queries'!
coveredClassNames
^ #( Base64Coder Base32Coder )
"Modified: / 26-08-2017 / 12:38:14 / cg"
! !
!EncoderTests methodsFor:'testing'!
test01_base64
|verbose|
verbose := false.
0 to:80 do:[:l |
|coder decoder data encoding decoded decoded2|
data := (0 to:l) asByteArray copyTo:l.
coder := Base64Coder on:'' writeStream.
coder nextPutAll:data.
coder flush.
encoding := coder contents.
decoder := Base64Coder on:encoding readStream.
decoded := decoder upToEnd.
verbose ifTrue:[
Transcript showCR:(data printString).
Transcript show:' -> '; showCR:encoding.
Transcript show:' ---> '; showCR:(decoded printString).
].
self assert:(data = decoded).
decoded2 := Base64Coder decode:encoding.
verbose ifTrue:[
Transcript showCR:(data printString).
Transcript show:' -> '; showCR:encoding.
Transcript show:' ---> '; showCR:(decoded2 printString).
].
self assert:(data = decoded2).
].
"
self new test01_base64
"
"Created: / 26-08-2017 / 12:38:40 / cg"
"Modified: / 30-09-2018 / 17:02:02 / Claus Gittinger"
!
test11_base32
|verbose|
verbose := false.
0 to:80 do:[:l |
|coder decoder data encoding decoded|
data := (0 to:l) asByteArray copyTo:l.
coder := Base32Coder on:'' writeStream.
coder nextPutAll:data.
coder flush.
encoding := coder contents.
decoder := Base32Coder on:encoding readStream.
decoded := decoder upToEnd.
verbose ifTrue:[
Transcript showCR:(data printString).
Transcript show:' -> '; showCR:encoding.
Transcript show:' ---> '; showCR:(decoded printString).
].
self assert:(data = decoded).
].
"
self new test11_base32
"
"Created: / 26-08-2017 / 12:38:59 / cg"
! !
!EncoderTests class methodsFor:'documentation'!
version
^ '$Header$'
!
version_CVS
^ '$Header$'
! !