aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2012-09-05 12:37:56 +0900
committerYuichiro Hanada <yhanada@google.com>2012-09-05 18:05:43 +0900
commit83dfe0fd8c7e2bce2717930dbf8732f5414ee39d (patch)
tree91b0b3342466924318178fc60172e0f27ef2deb1 /tests/src
parent8c220a0aa2c5139a3b12af20e68c420f6402294a (diff)
downloadlatinime-83dfe0fd8c7e2bce2717930dbf8732f5414ee39d.tar.gz
latinime-83dfe0fd8c7e2bce2717930dbf8732f5414ee39d.tar.xz
latinime-83dfe0fd8c7e2bce2717930dbf8732f5414ee39d.zip
Add FormatOptions.
Change-Id: Ibad05a5f9143de1156b2c897593ec89b0a0b07e7
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/latin/BinaryDictIOTests.java5
-rw-r--r--tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java5
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictIOTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictIOTests.java
index 9b7f4a7f9..c6ab52c48 100644
--- a/tests/src/com/android/inputmethod/latin/BinaryDictIOTests.java
+++ b/tests/src/com/android/inputmethod/latin/BinaryDictIOTests.java
@@ -52,6 +52,9 @@ public class BinaryDictIOTests extends AndroidTestCase {
private static final int BIGRAM_FREQ = 50;
private static final int TOLERANCE_OF_BIGRAM_FREQ = 5;
+ private static final BinaryDictInputOutput.FormatOptions VERSION2 =
+ new BinaryDictInputOutput.FormatOptions(2);
+
private static final String[] CHARACTERS =
{
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
@@ -112,7 +115,7 @@ public class BinaryDictIOTests extends AndroidTestCase {
final FileOutputStream out = new FileOutputStream(file);
now = System.currentTimeMillis();
- BinaryDictInputOutput.writeDictionaryBinary(out, dict, 2);
+ BinaryDictInputOutput.writeDictionaryBinary(out, dict, VERSION2);
diff = System.currentTimeMillis() - now;
out.flush();
diff --git a/tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java b/tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java
index 8f0551b4c..5fa740f6e 100644
--- a/tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java
@@ -18,6 +18,7 @@ package com.android.inputmethod.latin;
import com.android.inputmethod.latin.UserHistoryDictIOUtils.BigramDictionaryInterface;
import com.android.inputmethod.latin.UserHistoryDictIOUtils.OnAddWordListener;
+import com.android.inputmethod.latin.makedict.BinaryDictInputOutput;
import com.android.inputmethod.latin.makedict.FusionDictionary;
import com.android.inputmethod.latin.makedict.FusionDictionary.CharGroup;
@@ -44,6 +45,8 @@ public class UserHistoryDictIOUtilsTests extends AndroidTestCase
private static final int UNIGRAM_FREQUENCY = 50;
private static final int BIGRAM_FREQUENCY = 100;
private static final ArrayList<String> NOT_HAVE_BIGRAM = new ArrayList<String>();
+ private static final BinaryDictInputOutput.FormatOptions FORMAT_OPTIONS =
+ new BinaryDictInputOutput.FormatOptions(2);
/**
* Return same frequency for all words and bigrams
@@ -132,7 +135,7 @@ public class UserHistoryDictIOUtilsTests extends AndroidTestCase
final UserHistoryDictionaryBigramList bigramList) {
try {
final FileOutputStream out = new FileOutputStream(file);
- UserHistoryDictIOUtils.writeDictionaryBinary(out, this, bigramList, 2);
+ UserHistoryDictIOUtils.writeDictionaryBinary(out, this, bigramList, FORMAT_OPTIONS);
out.flush();
out.close();
} catch (IOException e) {