diff options
author | 2013-10-09 17:54:59 -0700 | |
---|---|---|
committer | 2013-10-09 17:54:59 -0700 | |
commit | a544cf0a4185ff46bdaa229dac4ff865c8bc4495 (patch) | |
tree | 589dd3c1c68acf7da25e302cdcac54b402da473c /tests/src | |
parent | 8037b971c24d150deb8aef4b442ed2b21e44e83a (diff) | |
parent | 879ae3aa927fd13d7fa49f19d87740e5c38a52e2 (diff) | |
download | latinime-a544cf0a4185ff46bdaa229dac4ff865c8bc4495.tar.gz latinime-a544cf0a4185ff46bdaa229dac4ff865c8bc4495.tar.xz latinime-a544cf0a4185ff46bdaa229dac4ff865c8bc4495.zip |
am 879ae3aa: am 21ce9c4a: Merge "Stochastic decay."
* commit '879ae3aa927fd13d7fa49f19d87740e5c38a52e2':
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(); |