The Inbox: MultilingualTests-HenrikSperreJohansen.10.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: MultilingualTests-HenrikSperreJohansen.10.mcz

commits-2
A new version of MultilingualTests was added to project The Inbox:
http://source.squeak.org/inbox/MultilingualTests-HenrikSperreJohansen.10.mcz

==================== Summary ====================

Name: MultilingualTests-HenrikSperreJohansen.10
Author: HenrikSperreJohansen
Time: 7 June 2010, 3:05:36.384 pm
UUID: 5cfa2572-27cc-4dbc-8eea-1ac0ccfe13ef
Ancestors: MultilingualTests-ul.9

Test for UTF16 with different byte orders.

=============== Diff against MultilingualTests-ul.9 ===============

Item was added:
+ TestCase subclass: #UTF16TextConverterTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'MultilingualTests-TextConversion'!

Item was added:
+ ----- Method: UTF16TextConverterTest>>testByteOrders (in category 'testing') -----
+ testByteOrders
+ |converter originalText bytes decodedText |
+ originalText := 'test'.
+ converter := UTF16TextConverter new.
+
+ "Default (ie useLittleEndian instvar nil)"
+ bytes := (originalText convertToWithConverter: converter).
+ decodedText := bytes convertFromWithConverter: converter.
+
+ self assert: originalText equals: decodedText.
+
+ "Little-endian"
+ converter useLittleEndian: true.
+
+ bytes := (originalText convertToWithConverter: converter).
+ decodedText := bytes convertFromWithConverter: converter.
+
+ self assert: originalText equals: decodedText.
+
+ "Big-endian"
+ converter useLittleEndian: false.
+
+ bytes := (originalText convertToWithConverter: converter).
+ decodedText := bytes convertFromWithConverter: converter.
+
+ self assert: originalText equals: decodedText.
+
+ !