diff options
Diffstat (limited to 'weaver/testsrc/LocaleTest.java')
-rw-r--r-- | weaver/testsrc/LocaleTest.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/weaver/testsrc/LocaleTest.java b/weaver/testsrc/LocaleTest.java new file mode 100644 index 000000000..1dba3f79f --- /dev/null +++ b/weaver/testsrc/LocaleTest.java @@ -0,0 +1,41 @@ +import java.io.IOException; +import java.util.Locale; + +import junit.framework.TestCase; + +import org.apache.bcel.generic.Instruction; +import org.apache.bcel.util.ByteSequence; + +public class LocaleTest extends TestCase { + + public LocaleTest(String name) { + super(name); + } + + public void testNormalLocale() { + doBipush(); + } + + public void testTurkishLocale() { + Locale def = Locale.getDefault(); + Locale.setDefault(new Locale("tr")); + try { + doBipush(); + } finally { + Locale.setDefault(def); + } + } + + private static void doBipush() { + try { + Instruction.readInstruction( + new ByteSequence(new byte[] { + (byte)16, // bipush + (byte) 3 // data for bipush + })); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} + |