diff options
author | 2014-10-31 06:55:23 +0000 | |
---|---|---|
committer | 2014-10-31 06:55:23 +0000 | |
commit | dca729bd21b3f1223df179e3b16fc9c1bba1acd4 (patch) | |
tree | 1e6e08497e7b05d3ed183a3da267b94ecfaecfd4 /tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java | |
parent | b524aa768cbf4e99cec705861df20dee4799ef4d (diff) | |
parent | 61d43e5c941e7a76d614ffbe756137c02a34cdc1 (diff) | |
download | latinime-dca729bd21b3f1223df179e3b16fc9c1bba1acd4.tar.gz latinime-dca729bd21b3f1223df179e3b16fc9c1bba1acd4.tar.xz latinime-dca729bd21b3f1223df179e3b16fc9c1bba1acd4.zip |
am 61d43e5c: Merge "Update unit tests for new static dict version."
* commit '61d43e5c941e7a76d614ffbe756137c02a34cdc1':
Update unit tests for new static dict version.
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java index 60e38250f..ce905c499 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java @@ -819,12 +819,18 @@ public class BinaryDictEncoderUtils { final ArrayList<Entry<Integer, Integer>> codePointOccurrenceArray) throws IOException, UnsupportedFormatException { final int version = formatOptions.mVersion; - if (version < FormatSpec.MINIMUM_SUPPORTED_VERSION - || version > FormatSpec.MAXIMUM_SUPPORTED_VERSION) { + if ((version >= FormatSpec.MINIMUM_SUPPORTED_STATIC_VERSION && + version <= FormatSpec.MAXIMUM_SUPPORTED_STATIC_VERSION) || ( + version >= FormatSpec.MINIMUM_SUPPORTED_DYNAMIC_VERSION && + version <= FormatSpec.MAXIMUM_SUPPORTED_DYNAMIC_VERSION)) { + // Dictionary is valid + } else { throw new UnsupportedFormatException("Requested file format version " + version - + ", but this implementation only supports versions " - + FormatSpec.MINIMUM_SUPPORTED_VERSION + " through " - + FormatSpec.MAXIMUM_SUPPORTED_VERSION); + + ", but this implementation only supports static versions " + + FormatSpec.MINIMUM_SUPPORTED_STATIC_VERSION + " through " + + FormatSpec.MAXIMUM_SUPPORTED_STATIC_VERSION + " and dynamic versions " + + FormatSpec.MINIMUM_SUPPORTED_DYNAMIC_VERSION + " through " + + FormatSpec.MAXIMUM_SUPPORTED_DYNAMIC_VERSION); } ByteArrayOutputStream headerBuffer = new ByteArrayOutputStream(256); |