aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2013-10-02 06:57:13 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-02 06:57:13 -0700
commit879ae3aa927fd13d7fa49f19d87740e5c38a52e2 (patch)
tree22945c10d02b15f0e7d95646786c44cd0e9e25af /tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java
parentda4d87ff000b594ede7cdb7bcb10e9272484f467 (diff)
parent21ce9c4a89f90593e54ae29670ebd09a14533665 (diff)
downloadlatinime-879ae3aa927fd13d7fa49f19d87740e5c38a52e2.tar.gz
latinime-879ae3aa927fd13d7fa49f19d87740e5c38a52e2.tar.xz
latinime-879ae3aa927fd13d7fa49f19d87740e5c38a52e2.zip
am 21ce9c4a: Merge "Stochastic decay."
* commit '21ce9c4a89f90593e54ae29670ebd09a14533665': 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();