aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2021-02-16 17:49:05 +0000
committerAdrian Roos <roosa@google.com>2021-02-16 17:49:08 +0000
commit8b3d8f48e1f9d95957e80f0133a29a0e7c251ec8 (patch)
treef55e27cde88acd7ac1af21dd1c584c33d4fb75fe
parent478d45fde7d8edf97cfef9948dceafe92448eec7 (diff)
downloadlatinime-8b3d8f48e1f9d95957e80f0133a29a0e7c251ec8.tar.gz
latinime-8b3d8f48e1f9d95957e80f0133a29a0e7c251ec8.tar.xz
latinime-8b3d8f48e1f9d95957e80f0133a29a0e7c251ec8.zip
Fix broken liblatinime_unittests
Change-Id: I95021965ecc2699fbce01ed0552dd28fed7f8fe4 Merged-In: I95021965ecc2699fbce01ed0552dd28fed7f8fe4 Fixes: 180014759 Test: atest liblatinime_unittests --host
-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)));
}