aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-07-04 16:51:46 +0900
committerJean Chalard <jchalard@google.com>2013-07-04 17:14:02 +0900
commitfe156213d7371a58d5bd5c5c0938415403e39a22 (patch)
tree655429598d90396c7a0114d3a3f99a7c1b3613b7 /tests/src/com/android
parentb6cc4333a88becaed03ead29a8a2d41babca6a41 (diff)
downloadlatinime-fe156213d7371a58d5bd5c5c0938415403e39a22.tar.gz
latinime-fe156213d7371a58d5bd5c5c0938415403e39a22.tar.xz
latinime-fe156213d7371a58d5bd5c5c0938415403e39a22.zip
Add a two-args constructor to BinaryDictIOTests
Change-Id: Ie26e22754bfa5d58135349164c57007c86bd97e8
Diffstat (limited to 'tests/src/com/android')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
index cca81a0e0..87acafee6 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
@@ -51,7 +51,7 @@ import java.util.Set;
@LargeTest
public class BinaryDictIOTests extends AndroidTestCase {
private static final String TAG = BinaryDictIOTests.class.getSimpleName();
- private static final int MAX_UNIGRAMS = 100;
+ private static final int DEFAULT_MAX_UNIGRAMS = 100;
private static final int UNIGRAM_FREQ = 10;
private static final int BIGRAM_FREQ = 50;
private static final int TOLERANCE_OF_BIGRAM_FREQ = 5;
@@ -73,13 +73,15 @@ public class BinaryDictIOTests extends AndroidTestCase {
new FormatSpec.FormatOptions(3, true /* supportsDynamicUpdate */);
public BinaryDictIOTests() {
- super();
+ this(System.currentTimeMillis(), DEFAULT_MAX_UNIGRAMS);
+ }
- final long time = System.currentTimeMillis();
- Log.e(TAG, "Testing dictionary: seed is " + time);
- final Random random = new Random(time);
+ public BinaryDictIOTests(final long seed, final int maxUnigrams) {
+ super();
+ Log.e(TAG, "Testing dictionary: seed is " + seed);
+ final Random random = new Random(seed);
sWords.clear();
- generateWords(MAX_UNIGRAMS, random);
+ generateWords(maxUnigrams, random);
for (int i = 0; i < sWords.size(); ++i) {
sChainBigrams.put(i, new ArrayList<Integer>());