aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/inputmethod/latin')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
index bd8729203..89913fa0a 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java
@@ -137,7 +137,10 @@ public class BinaryDictIOTests extends AndroidTestCase {
if (r < 0) continue;
// Don't insert 0~20, but insert any other code point.
// Code points are in the range 0~0x10FFFF.
- builder.appendCodePoint((int)(20 + r % (0x10FFFF - 20)));
+ final int candidateCodePoint = (int)(20 + r % (0x10FFFF - 20));
+ // Code points between 0xD800 and 0xDFFF are not valid.
+ if (candidateCodePoint >= 0xD800 && candidateCodePoint <= 0xDFFF) continue;
+ builder.appendCodePoint(candidadeCodePoint);
--count;
}
return builder.toString();