harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enh <...@google.com>
Subject StringTest.test_getBytesLCharset
Date Wed, 10 Mar 2010 01:25:05 GMT
can anyone explain this test?

       byte[] someBytes = new byte[]{'T','h','i','s',' ','
','i','s',' ','t','e','s','t',' ','b','y','t','e','s'};
...
       SortedMap<String, Charset> charsets = Charset.availableCharsets();
...
       if (charsets.size() >= 2){
           assertTrue(bytesEquals(someBytes,new String(someBytes,
charsets.get(charsets.firstKey())).getBytes(charsets.get(charsets.lastKey()))));

i don't understand why it's necessarily true that we can roundtrip
between the first and last charsets in the map. surely that depends on
the exact contents of the map? or am i missing something?

was the intention to iterate through the map and try to round-trip for
each charset in the map?

(this is on the java 6 branch.)

-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/

Mime
View raw message