aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/tests/dictionary/utils/format_utils_test.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-02-16 19:35:32 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-16 19:35:32 +0000
commit326ff853c7a29bd4f11108d1aae6b4b70c902b29 (patch)
treef55e27cde88acd7ac1af21dd1c584c33d4fb75fe /native/jni/tests/dictionary/utils/format_utils_test.cpp
parent644c0062b9b852a8cbb51dfc0f187d0165f1cd15 (diff)
parent5e1756c5fed2df01f16dbfee5aab6a34f452c12a (diff)
downloadlatinime-326ff853c7a29bd4f11108d1aae6b4b70c902b29.tar.gz
latinime-326ff853c7a29bd4f11108d1aae6b4b70c902b29.tar.xz
latinime-326ff853c7a29bd4f11108d1aae6b4b70c902b29.zip
Merge "Fix broken liblatinime_unittests" am: 62013c4f80 am: 5e1756c5fe
Original change: https://android-review.googlesource.com/c/platform/packages/inputmethods/LatinIME/+/1589747 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I6dd60fb5d01feed612f81fbb33adf07b1abec0cc
Diffstat (limited to 'native/jni/tests/dictionary/utils/format_utils_test.cpp')
-rw-r--r--native/jni/tests/dictionary/utils/format_utils_test.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/native/jni/tests/dictionary/utils/format_utils_test.cpp b/native/jni/tests/dictionary/utils/format_utils_test.cpp
index 3561bda30..34defe78c 100644
--- a/native/jni/tests/dictionary/utils/format_utils_test.cpp
+++ b/native/jni/tests/dictionary/utils/format_utils_test.cpp
@@ -57,7 +57,13 @@ TEST(FormatUtilsTest, TestDetectFormatVersion) {
{
const std::vector<uint8_t> buffer =
getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_2, 0, 0);
- EXPECT_EQ(FormatUtils::VERSION_2, FormatUtils::detectFormatVersion(
+ EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion(
+ ReadOnlyByteArrayView(buffer.data(), buffer.size())));
+ }
+ {
+ const std::vector<uint8_t> buffer =
+ getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_202, 0, 0);
+ EXPECT_EQ(FormatUtils::VERSION_202, FormatUtils::detectFormatVersion(
ReadOnlyByteArrayView(buffer.data(), buffer.size())));
}
{
@@ -75,7 +81,7 @@ TEST(FormatUtilsTest, TestDetectFormatVersion) {
{
const std::vector<uint8_t> buffer =
- getBuffer(FormatUtils::MAGIC_NUMBER - 1, FormatUtils::VERSION_2, 0, 0);
+ getBuffer(FormatUtils::MAGIC_NUMBER - 1, FormatUtils::VERSION_402, 0, 0);
EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion(
ReadOnlyByteArrayView(buffer.data(), buffer.size())));
}
@@ -87,7 +93,7 @@ TEST(FormatUtilsTest, TestDetectFormatVersion) {
}
{
const std::vector<uint8_t> buffer =
- getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_2, 0, 0);
+ getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_402, 0, 0);
EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion(
ReadOnlyByteArrayView(buffer.data(), buffer.size() - 1)));
}