aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2012-09-18 15:28:05 +0900
committerYuichiro Hanada <yhanada@google.com>2012-09-18 21:20:07 +0900
commitbf45dc4860ab28e97c3e7d116a642802fe960239 (patch)
treed00e101713aff07b1151e3ac9e8410f2dcdaebe6 /tests
parent061d225fb1d110695b396a470d9ae6a9a3331003 (diff)
downloadlatinime-bf45dc4860ab28e97c3e7d116a642802fe960239.tar.gz
latinime-bf45dc4860ab28e97c3e7d116a642802fe960239.tar.xz
latinime-bf45dc4860ab28e97c3e7d116a642802fe960239.zip
Make writePlacedNode write the linked-list node.
Change-Id: I60feda815ea08cf73300fccca1ae12b97550f116
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
index 328784b1a..a87146ee2 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
@@ -65,9 +65,12 @@ public class BinaryDictIOTests extends AndroidTestCase {
private static final FormatSpec.FormatOptions VERSION2 = new FormatSpec.FormatOptions(2);
private static final FormatSpec.FormatOptions VERSION3_WITHOUT_PARENTADDRESS =
- new FormatSpec.FormatOptions(3, false);
+ new FormatSpec.FormatOptions(3, false /* hasParentAddress */);
private static final FormatSpec.FormatOptions VERSION3_WITH_PARENTADDRESS =
- new FormatSpec.FormatOptions(3, true);
+ new FormatSpec.FormatOptions(3, true /* hasParentAddress */);
+ private static final FormatSpec.FormatOptions VERSION3_WITH_LINKEDLIST_NODE =
+ new FormatSpec.FormatOptions(3, true /* hasParentAddress */,
+ true /* hasLinkedListNode */);
private static final String[] CHARACTERS = {
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
@@ -236,7 +239,8 @@ public class BinaryDictIOTests extends AndroidTestCase {
String result = " : buffer type = "
+ ((bufferType == USE_BYTE_BUFFER) ? "byte buffer" : "byte array");
result += " : version = " + formatOptions.mVersion;
- return result + ", hasParentAddress = " + formatOptions.mHasParentAddress;
+ return result + ", hasParentAddress = " + formatOptions.mHasParentAddress
+ + ", hasLinkedListNode = " + formatOptions.mHasLinkedListNode;
}
// Tests for readDictionaryBinary and writeDictionaryBinary
@@ -305,6 +309,7 @@ public class BinaryDictIOTests extends AndroidTestCase {
runReadAndWriteTests(results, USE_BYTE_BUFFER, VERSION2);
runReadAndWriteTests(results, USE_BYTE_BUFFER, VERSION3_WITHOUT_PARENTADDRESS);
runReadAndWriteTests(results, USE_BYTE_BUFFER, VERSION3_WITH_PARENTADDRESS);
+ runReadAndWriteTests(results, USE_BYTE_BUFFER, VERSION3_WITH_LINKEDLIST_NODE);
for (final String result : results) {
Log.d(TAG, result);
@@ -317,6 +322,7 @@ public class BinaryDictIOTests extends AndroidTestCase {
runReadAndWriteTests(results, USE_BYTE_ARRAY, VERSION2);
runReadAndWriteTests(results, USE_BYTE_ARRAY, VERSION3_WITHOUT_PARENTADDRESS);
runReadAndWriteTests(results, USE_BYTE_ARRAY, VERSION3_WITH_PARENTADDRESS);
+ runReadAndWriteTests(results, USE_BYTE_ARRAY, VERSION3_WITH_LINKEDLIST_NODE);
for (final String result : results) {
Log.d(TAG, result);
@@ -450,6 +456,7 @@ public class BinaryDictIOTests extends AndroidTestCase {
runReadUnigramsAndBigramsTests(results, USE_BYTE_BUFFER, VERSION2);
runReadUnigramsAndBigramsTests(results, USE_BYTE_BUFFER, VERSION3_WITHOUT_PARENTADDRESS);
runReadUnigramsAndBigramsTests(results, USE_BYTE_BUFFER, VERSION3_WITH_PARENTADDRESS);
+ runReadUnigramsAndBigramsTests(results, USE_BYTE_BUFFER, VERSION3_WITH_LINKEDLIST_NODE);
for (final String result : results) {
Log.d(TAG, result);
@@ -462,6 +469,7 @@ public class BinaryDictIOTests extends AndroidTestCase {
runReadUnigramsAndBigramsTests(results, USE_BYTE_ARRAY, VERSION2);
runReadUnigramsAndBigramsTests(results, USE_BYTE_ARRAY, VERSION3_WITHOUT_PARENTADDRESS);
runReadUnigramsAndBigramsTests(results, USE_BYTE_ARRAY, VERSION3_WITH_PARENTADDRESS);
+ runReadUnigramsAndBigramsTests(results, USE_BYTE_ARRAY, VERSION3_WITH_LINKEDLIST_NODE);
for (final String result : results) {
Log.d(TAG, result);