aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2013-10-02 09:37:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-02 09:37:56 +0000
commit21ce9c4a89f90593e54ae29670ebd09a14533665 (patch)
tree0d02c1f6c983d1e1e710f957b0c1c488ac2c14e2 /tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
parent2dcb63375d9f6dbdbcd1334571f6e80b4d487771 (diff)
parentc76bbceedc804d1f2988cbf032b530a107a7d561 (diff)
downloadlatinime-21ce9c4a89f90593e54ae29670ebd09a14533665.tar.gz
latinime-21ce9c4a89f90593e54ae29670ebd09a14533665.tar.xz
latinime-21ce9c4a89f90593e54ae29670ebd09a14533665.zip
Merge "Stochastic decay."
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
index 8a439fc22..b2d31c21f 100644
--- a/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
+++ b/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
@@ -50,14 +50,18 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase {
}
private void forcePassingShortTime(final BinaryDictionary binaryDictionary) {
- binaryDictionary.getPropertyForTests(SET_NEEDS_TO_DECAY_FOR_TESTING_KEY);
- binaryDictionary.flushWithGC();
+ // Entries having low probability would be suppressed once in 2 GCs.
+ final int count = 2;
+ for (int i = 0; i < count; i++) {
+ binaryDictionary.getPropertyForTests(SET_NEEDS_TO_DECAY_FOR_TESTING_KEY);
+ binaryDictionary.flushWithGC();
+ }
}
private void forcePassingLongTime(final BinaryDictionary binaryDictionary) {
// Currently, probabilities are decayed when GC is run. All entries that have never been
- // typed in 32 GCs are removed.
- final int count = 32;
+ // typed in 128 GCs would be removed.
+ final int count = 128;
for (int i = 0; i < count; i++) {
binaryDictionary.getPropertyForTests(SET_NEEDS_TO_DECAY_FOR_TESTING_KEY);
binaryDictionary.flushWithGC();