From bb5b84a82630bc2309c9ae866d43c7934768bb2e Mon Sep 17 00:00:00 2001 From: Yuichiro Hanada Date: Fri, 23 Aug 2013 23:23:03 +0900 Subject: [Refactor] Add DictDecoder.getTerminalPosition. Change-Id: I9d04f64a58f5481cbb64cf1c09b5c485dd4176b4 --- .../latin/makedict/BinaryDictDecoderEncoderTests.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java') diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java index 98f06a6c2..bb5b96a48 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java @@ -555,7 +555,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { int position = -1; try { final long now = System.nanoTime(); - position = BinaryDictIOUtils.getTerminalPosition(dictDecoder, word); + position = dictDecoder.getTerminalPosition(word); diff = System.nanoTime() - now; } catch (IOException e) { Log.e(TAG, "IOException while getTerminalPosition", e); @@ -596,16 +596,13 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { try { // too long word final String longWord = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; - assertEquals(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, longWord)); + assertEquals(FormatSpec.NOT_VALID_WORD, dictDecoder.getTerminalPosition(longWord)); // null - assertEquals(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, null)); + assertEquals(FormatSpec.NOT_VALID_WORD, dictDecoder.getTerminalPosition(null)); // empty string - assertEquals(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, "")); + assertEquals(FormatSpec.NOT_VALID_WORD, dictDecoder.getTerminalPosition("")); } catch (IOException e) { } catch (UnsupportedFormatException e) { } @@ -655,16 +652,16 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase { try { MoreAsserts.assertNotEqual(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, sWords.get(0))); + dictDecoder.getTerminalPosition(sWords.get(0))); DynamicBinaryDictIOUtils.deleteWord(dictDecoder, sWords.get(0)); assertEquals(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, sWords.get(0))); + dictDecoder.getTerminalPosition(sWords.get(0))); MoreAsserts.assertNotEqual(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, sWords.get(5))); + dictDecoder.getTerminalPosition(sWords.get(5))); DynamicBinaryDictIOUtils.deleteWord(dictDecoder, sWords.get(5)); assertEquals(FormatSpec.NOT_VALID_WORD, - BinaryDictIOUtils.getTerminalPosition(dictDecoder, sWords.get(5))); + dictDecoder.getTerminalPosition(sWords.get(5))); } catch (IOException e) { } catch (UnsupportedFormatException e) { } -- cgit v1.2.3-83-g751a