aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-10-21 15:06:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-21 15:06:55 +0000
commit46a007261fcbfbe887e22ecdf16307f95b1e4024 (patch)
treed47b90911c51c7ff6eabb6466f47a84d4574cbba /tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
parent0b8bb0c21bda18e77a52d980891d56430e113a6f (diff)
parent5f00fe09e9a611b647592188316e5999465df4d3 (diff)
downloadlatinime-46a007261fcbfbe887e22ecdf16307f95b1e4024.tar.gz
latinime-46a007261fcbfbe887e22ecdf16307f95b1e4024.tar.xz
latinime-46a007261fcbfbe887e22ecdf16307f95b1e4024.zip
Merge "Fix some compiler warnings"
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java28
1 files changed, 14 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 05616d888..d1cb14196 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
@@ -117,7 +117,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
super.tearDown();
}
- private void generateWords(final int number, final Random random) {
+ private static void generateWords(final int number, final Random random) {
final int[] codePointSet = CodePointUtils.generateCodePointSet(DEFAULT_CODE_POINT_SET_SIZE,
random);
final Set<String> wordSet = new HashSet<>();
@@ -138,7 +138,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
/**
* Adds unigrams to the dictionary.
*/
- private void addUnigrams(final int number, final FusionDictionary dict,
+ private static void addUnigrams(final int number, final FusionDictionary dict,
final List<String> words, final HashMap<String, List<String>> shortcutMap) {
for (int i = 0; i < number; ++i) {
final String word = words.get(i);
@@ -154,7 +154,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
}
- private void addBigrams(final FusionDictionary dict,
+ private static void addBigrams(final FusionDictionary dict,
final List<String> words,
final SparseArray<List<Integer>> bigrams) {
for (int i = 0; i < bigrams.size(); ++i) {
@@ -173,7 +173,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
// new java.io.FileWriter(new File(filename)), dict);
// }
- private long timeWritingDictToFile(final File file, final FusionDictionary dict,
+ private static long timeWritingDictToFile(final File file, final FusionDictionary dict,
final FormatSpec.FormatOptions formatOptions) {
long now = -1, diff = -1;
@@ -196,7 +196,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
return diff;
}
- private void checkDictionary(final FusionDictionary dict, final List<String> words,
+ private static void checkDictionary(final FusionDictionary dict, final List<String> words,
final SparseArray<List<Integer>> bigrams,
final HashMap<String, List<String>> shortcutMap) {
assertNotNull(dict);
@@ -231,16 +231,16 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
}
- private String outputOptions(final int bufferType,
+ private static String outputOptions(final int bufferType,
final FormatSpec.FormatOptions formatOptions) {
- String result = " : buffer type = "
+ final String result = " : buffer type = "
+ ((bufferType == BinaryDictUtils.USE_BYTE_BUFFER) ? "byte buffer" : "byte array");
return result + " : version = " + formatOptions.mVersion;
}
// Tests for readDictionaryBinary and writeDictionaryBinary
- private long timeReadingAndCheckDict(final File file, final List<String> words,
+ private static long timeReadingAndCheckDict(final File file, final List<String> words,
final SparseArray<List<Integer>> bigrams,
final HashMap<String, List<String>> shortcutMap, final int bufferType) {
long now, diff = -1;
@@ -385,7 +385,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
// Tests for readUnigramsAndBigramsBinary
- private void checkWordMap(final List<String> expectedWords,
+ private static void checkWordMap(final List<String> expectedWords,
final SparseArray<List<Integer>> expectedBigrams,
final TreeMap<Integer, String> resultWords,
final TreeMap<Integer, Integer> resultFrequencies,
@@ -434,9 +434,9 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
assertEquals(actBigrams, expBigrams);
}
- private long timeAndCheckReadUnigramsAndBigramsBinary(final File file, final List<String> words,
- final SparseArray<List<Integer>> bigrams, final int bufferType,
- final boolean checkProbability) {
+ private static long timeAndCheckReadUnigramsAndBigramsBinary(final File file,
+ final List<String> words, final SparseArray<List<Integer>> bigrams,
+ final int bufferType, final boolean checkProbability) {
final TreeMap<Integer, String> resultWords = new TreeMap<>();
final TreeMap<Integer, ArrayList<PendingAttribute>> resultBigrams = new TreeMap<>();
final TreeMap<Integer, Integer> resultFreqs = new TreeMap<>();
@@ -519,7 +519,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
// Tests for getTerminalPosition
- private String getWordFromBinary(final DictDecoder dictDecoder, final int address) {
+ private static String getWordFromBinary(final DictDecoder dictDecoder, final int address) {
if (dictDecoder.getPosition() != 0) dictDecoder.setPosition(0);
DictionaryHeader fileHeader = null;
@@ -535,7 +535,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
address).mWord;
}
- private long checkGetTerminalPosition(final DictDecoder dictDecoder, final String word,
+ private static long checkGetTerminalPosition(final DictDecoder dictDecoder, final String word,
final boolean contained) {
long diff = -1;
int position = -1;