From b868375763de60d1a1ff6fa21b121cc1b61df842 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 16 Dec 2013 14:17:33 +0900 Subject: Fix failing tests - Version 3 is not supported - Now passing the right string to open v4 dicts. Fix the tests for this. Change-Id: I7829330c3568a715b96396ba4e4e69c6e17775ab --- java/src/com/android/inputmethod/latin/makedict/FormatSpec.java | 1 - java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java | 2 +- java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java index f23fe4656..2f6f194aa 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java @@ -188,7 +188,6 @@ public final class FormatSpec { // us to change the format during development while having testing devices remove // older files with each upgrade, while still having a readable versioning scheme. public static final int VERSION2 = 2; - public static final int VERSION3 = 3; public static final int VERSION4 = 400; static final int MINIMUM_SUPPORTED_VERSION = VERSION2; static final int MAXIMUM_SUPPORTED_VERSION = VERSION4; diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java index 665544228..e5430423d 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java @@ -68,7 +68,7 @@ public class Ver2DictEncoder implements DictEncoder { @Override public void writeDictionary(final FusionDictionary dict, final FormatOptions formatOptions) throws IOException, UnsupportedFormatException { - if (formatOptions.mVersion > FormatSpec.VERSION3) { + if (formatOptions.mVersion > FormatSpec.VERSION2) { throw new UnsupportedFormatException( "The given format options has wrong version number : " + formatOptions.mVersion); diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java index a746f9945..8eaee4d9f 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java @@ -56,7 +56,8 @@ public class Ver4DictEncoder implements DictEncoder { } if (!BinaryDictionary.createEmptyDictFile(mDictPlacedDir.getAbsolutePath(), FormatSpec.VERSION4, dict.mOptions.mAttributes)) { - throw new IOException("Cannot create dictionary file"); + throw new IOException("Cannot create dictionary file : " + + mDictPlacedDir.getAbsolutePath()); } final BinaryDictionary binaryDict = new BinaryDictionary(mDictPlacedDir.getAbsolutePath(), 0l, mDictPlacedDir.length(), true /* useFullEditDistance */, -- cgit v1.2.3-83-g751a