aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2013-09-30 11:42:52 +0900
committerYuichiro Hanada <yhanada@google.com>2013-10-03 20:16:34 +0900
commitd6e307a4b7933ad5efebc6b0d3b775c5ab5c0e6e (patch)
tree719e0b159c2c886f31dd7829931af9630faf1693 /tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
parent7e6e97014d7d031f233267220a627b3dfdfd26dc (diff)
downloadlatinime-d6e307a4b7933ad5efebc6b0d3b775c5ab5c0e6e.tar.gz
latinime-d6e307a4b7933ad5efebc6b0d3b775c5ab5c0e6e.tar.xz
latinime-d6e307a4b7933ad5efebc6b0d3b775c5ab5c0e6e.zip
Add DictUpdater.
Change-Id: Ic586e46e5a9f59de53d53e59886d635345940974
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) {
}