diff options
author | 2013-10-09 19:33:00 -0700 | |
---|---|---|
committer | 2013-10-09 19:33:00 -0700 | |
commit | 4ff72a62401c2fb7f4a301efb264c727bda16ab1 (patch) | |
tree | 589dd3c1c68acf7da25e302cdcac54b402da473c /tests/src | |
parent | fce7e730f05a6f81b5580d9258d4609b0dc8b97c (diff) | |
parent | a544cf0a4185ff46bdaa229dac4ff865c8bc4495 (diff) | |
download | latinime-4ff72a62401c2fb7f4a301efb264c727bda16ab1.tar.gz latinime-4ff72a62401c2fb7f4a301efb264c727bda16ab1.tar.xz latinime-4ff72a62401c2fb7f4a301efb264c727bda16ab1.zip |
am a544cf0a: am 879ae3aa: am 21ce9c4a: Merge "Stochastic decay."
* commit 'a544cf0a4185ff46bdaa229dac4ff865c8bc4495':
Stochastic decay.
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java | 12 |
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(); |