diff options
author | 2013-07-11 15:49:11 +0900 | |
---|---|---|
committer | 2013-07-16 15:57:09 +0900 | |
commit | 1588252968dd47ec483756e1c9f0d059896896fb (patch) | |
tree | cb9dd42323f75a9abc014ad786d3d52e88337a67 /tests/src | |
parent | b6f286bfa549ed91c67d591fc1725e35b114742b (diff) | |
download | latinime-1588252968dd47ec483756e1c9f0d059896896fb.tar.gz latinime-1588252968dd47ec483756e1c9f0d059896896fb.tar.xz latinime-1588252968dd47ec483756e1c9f0d059896896fb.zip |
Small debug helper
So that I don't have to find out everything again each time the
test facility finds a case that does not work, and I want to dump
the output to a combined file.
Change-Id: I9f77f86055d1609c2e37747ac47421db1ba2498e
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java index 55f163255..5ecacc1a8 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java @@ -206,6 +206,14 @@ public class BinaryDictIOTests extends AndroidTestCase { } } +// The following is useful to dump the dictionary into a textual file, but it can't compile +// on-device, so it's commented out. +// private void dumpToCombinedFileForDebug(final FusionDictionary dict, final String filename) +// throws IOException { +// com.android.inputmethod.latin.dicttool.CombinedInputOutput.writeDictionaryCombined( +// new java.io.FileWriter(new File(filename)), dict); +// } + private long timeWritingDictToFile(final File file, final FusionDictionary dict, final FormatSpec.FormatOptions formatOptions) { @@ -215,6 +223,9 @@ public class BinaryDictIOTests extends AndroidTestCase { final FileOutputStream out = new FileOutputStream(file); now = System.currentTimeMillis(); + // If you need to dump the dict to a textual file, uncomment the line below and the + // function above + // dumpToCombinedFileForDebug(file, "/tmp/foo"); BinaryDictInputOutput.writeDictionaryBinary(out, dict, formatOptions); diff = System.currentTimeMillis() - now; |