diff options
author | 2014-02-04 21:36:04 +0900 | |
---|---|---|
committer | 2014-02-04 21:36:04 +0900 | |
commit | b986f78ba826fa360304a69565f1880bdd7ce0c5 (patch) | |
tree | 5d19c033ee15e575a78a51f8c092b3877632e664 /tools/dicttool/tests | |
parent | 36c7a62dffb7f5b6728fa0850c1f63aee0f14d80 (diff) | |
download | latinime-b986f78ba826fa360304a69565f1880bdd7ce0c5.tar.gz latinime-b986f78ba826fa360304a69565f1880bdd7ce0c5.tar.xz latinime-b986f78ba826fa360304a69565f1880bdd7ce0c5.zip |
Separate header class from FormatSpec.
Bug: 12810574
Change-Id: Iacf1cd05a268bf690ab864b5e32a18a4b0ccc693
Diffstat (limited to 'tools/dicttool/tests')
-rw-r--r-- | tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java b/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java index d8059e428..9ed4dd5a2 100644 --- a/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java +++ b/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java @@ -18,6 +18,7 @@ package com.android.inputmethod.latin.dicttool; import com.android.inputmethod.latin.makedict.DictDecoder; import com.android.inputmethod.latin.makedict.DictEncoder; +import com.android.inputmethod.latin.makedict.DictionaryHeader; import com.android.inputmethod.latin.makedict.FormatSpec; import com.android.inputmethod.latin.makedict.FormatSpec.FormatOptions; import com.android.inputmethod.latin.makedict.FusionDictionary; @@ -48,9 +49,9 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase { // Create a thrice-compressed dictionary file. final DictionaryOptions testOptions = new DictionaryOptions(new HashMap<String, String>()); - testOptions.mAttributes.put(FormatSpec.FileHeader.DICTIONARY_VERSION_KEY, VERSION); - testOptions.mAttributes.put(FormatSpec.FileHeader.DICTIONARY_LOCALE_KEY, LOCALE); - testOptions.mAttributes.put(FormatSpec.FileHeader.DICTIONARY_ID_KEY, ID); + testOptions.mAttributes.put(DictionaryHeader.DICTIONARY_VERSION_KEY, VERSION); + testOptions.mAttributes.put(DictionaryHeader.DICTIONARY_LOCALE_KEY, LOCALE); + testOptions.mAttributes.put(DictionaryHeader.DICTIONARY_ID_KEY, ID); final FusionDictionary dict = new FusionDictionary(new PtNodeArray(), testOptions); dict.add("foo", TEST_FREQ, null, false /* isNotAWord */); dict.add("fta", 1, null, false /* isNotAWord */); @@ -80,11 +81,11 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase { null /* dict : an optional dictionary to add words to, or null */, false /* deleteDictIfBroken */); assertEquals("Wrong version attribute", VERSION, resultDict.mOptions.mAttributes.get( - FormatSpec.FileHeader.DICTIONARY_VERSION_KEY)); + DictionaryHeader.DICTIONARY_VERSION_KEY)); assertEquals("Wrong locale attribute", LOCALE, resultDict.mOptions.mAttributes.get( - FormatSpec.FileHeader.DICTIONARY_LOCALE_KEY)); + DictionaryHeader.DICTIONARY_LOCALE_KEY)); assertEquals("Wrong id attribute", ID, resultDict.mOptions.mAttributes.get( - FormatSpec.FileHeader.DICTIONARY_ID_KEY)); + DictionaryHeader.DICTIONARY_ID_KEY)); assertEquals("Dictionary can't be read back correctly", FusionDictionary.findWordInTree(resultDict.mRootNodeArray, "foo").getFrequency(), TEST_FREQ); |