aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2013-10-09 19:33:30 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-09 19:33:30 -0700
commit55e6f49e9d1ac5390d3cab5fea14b781e6532509 (patch)
treee1823e340be578ad5ebce06e01bd7d54cc376bb8 /tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
parent3a82852bdde505124581f1e77689b2efbcc3dfa8 (diff)
parentfd91482b5e59800f2de9511ead9f00051b190156 (diff)
downloadlatinime-55e6f49e9d1ac5390d3cab5fea14b781e6532509.tar.gz
latinime-55e6f49e9d1ac5390d3cab5fea14b781e6532509.tar.xz
latinime-55e6f49e9d1ac5390d3cab5fea14b781e6532509.zip
am fd91482b: am 8e19d4a1: am d6e307a4: Add DictUpdater.
* commit 'fd91482b5e59800f2de9511ead9f00051b190156': Add DictUpdater.
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
index 0cf4ef9f1..aa1658301 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
@@ -657,27 +657,21 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
addUnigrams(sWords.size(), dict, sWords, null /* shortcutMap */);
timeWritingDictToFile(file, dict, VERSION3_WITH_DYNAMIC_UPDATE);
- final Ver3DictDecoder dictDecoder = new Ver3DictDecoder(file, DictDecoder.USE_BYTEARRAY);
- try {
- dictDecoder.openDictBuffer();
- } catch (IOException e) {
- // ignore
- Log.e(TAG, "IOException while opening the buffer", e);
- }
- assertTrue("Can't get the buffer", dictDecoder.isDictBufferOpen());
+ final Ver3DictUpdater dictUpdater = new Ver3DictUpdater(file,
+ DictDecoder.USE_WRITABLE_BYTEBUFFER);
try {
MoreAsserts.assertNotEqual(FormatSpec.NOT_VALID_WORD,
- dictDecoder.getTerminalPosition(sWords.get(0)));
- DynamicBinaryDictIOUtils.deleteWord(dictDecoder, sWords.get(0));
+ dictUpdater.getTerminalPosition(sWords.get(0)));
+ dictUpdater.deleteWord(sWords.get(0));
assertEquals(FormatSpec.NOT_VALID_WORD,
- dictDecoder.getTerminalPosition(sWords.get(0)));
+ dictUpdater.getTerminalPosition(sWords.get(0)));
MoreAsserts.assertNotEqual(FormatSpec.NOT_VALID_WORD,
- dictDecoder.getTerminalPosition(sWords.get(5)));
- DynamicBinaryDictIOUtils.deleteWord(dictDecoder, sWords.get(5));
+ dictUpdater.getTerminalPosition(sWords.get(5)));
+ dictUpdater.deleteWord(sWords.get(5));
assertEquals(FormatSpec.NOT_VALID_WORD,
- dictDecoder.getTerminalPosition(sWords.get(5)));
+ dictUpdater.getTerminalPosition(sWords.get(5)));
} catch (IOException e) {
} catch (UnsupportedFormatException e) {
}