• R/O
  • SSH

TogaGem: Commit

TogaGemは、3D動画制作ツール、MikuMikuDance(MMD)で用いられる各種データファイルを読み書きするためのJavaライブラリです。
旧TogaParserライブラリの資産は、TogaGemライブラリに吸収されました。


Commit MetaInfo

Revision545fd816cd685eb349d56cf11590fb6d6b0c41b8 (tree)
Zeit2013-04-17 20:12:37
Autor <olyutorskii@user...>

Log Message

JRE1.6と1.7の差を吸収

Ändern Zusammenfassung

Diff

diff -r fe192bef4a2f -r 545fd816cd68 src/test/java/jp/sfjp/mikutoga/bin/export/TextExporterTest.java
--- a/src/test/java/jp/sfjp/mikutoga/bin/export/TextExporterTest.java Wed Apr 17 08:10:03 2013 +0900
+++ b/src/test/java/jp/sfjp/mikutoga/bin/export/TextExporterTest.java Wed Apr 17 20:12:37 2013 +0900
@@ -106,8 +106,12 @@
106106 ByteArrayOutputStream bout = new ByteArrayOutputStream();
107107
108108 exporter = new TextExporter(CS_UTF8);
109+ // JRE 1.6 と 1.7 でびみょーに違う
110+ float maxb = CS_UTF8.newEncoder().maxBytesPerChar();
111+
109112 exporter.setCharBufSize(1);
110- exporter.setByteBufSize(4);
113+ int minb = (int)( StrictMath.floor(maxb) );
114+ exporter.setByteBufSize(minb);
111115 bout.reset();
112116 try{
113117 exporter.encodeToByteStream("あいう", bout);
@@ -117,7 +121,8 @@
117121 assertEquals(9, bout.size());
118122
119123 try{
120- exporter.setByteBufSize(3);
124+ int failSize = minb - 1;
125+ exporter.setByteBufSize(failSize);
121126 fail();
122127 }catch(IllegalArgumentException e){
123128 // GOOD
Show on old repository browser