aboutsummaryrefslogtreecommitdiffstats
path: root/Tests.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-20 00:39:06 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-20 00:39:06 +0100
commit382a6688a4c21d923c12d50c60a100365d8ece2d (patch)
treedee84fa7b7e7f4bfcc45ad31ecdee9c43b435adb /Tests.st
parent7060fa4059456a466e0473fbff4ee70591e7c0e9 (diff)
MessageBuffer: Allow to add a messagebuffer as a bytearray
Make it possible to add the messagebuffer as a normal byte array. This should be improved and the MessageBuffer should implement a Collection or such.
Diffstat (limited to 'Tests.st')
-rw-r--r--Tests.st21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests.st b/Tests.st
index 51a9470..340df36 100644
--- a/Tests.st
+++ b/Tests.st
@@ -61,3 +61,24 @@ TestCase subclass: IPATests [
self assert: IPASCCPState sizeof = 25.
]
]
+
+TestCase subclass: MessageBufferTest [
+ testAdd [
+ | msg1 msg2 msg3 msg_master |
+ msg1 := MessageBuffer new.
+ msg2 := MessageBuffer new.
+ msg3 := MessageBuffer new.
+
+ msg1 putByteArray: #(1 2 3) asByteArray.
+ msg2 putByteArray: #(4 5 6) asByteArray.
+ msg3 putByteArray: #(7 8 9) asByteArray.
+
+ msg_master := MessageBuffer new.
+ msg_master putByteArray: msg1.
+ msg_master putByteArray: msg2.
+ msg_master putByteArray: msg3.
+
+ self assert: msg_master size = 9.
+ self assert: msg_master toByteArray = #(1 2 3 4 5 6 7 8 9) asByteArray.
+ ]
+]