Merge "Fix broken liblatinime_unittests" am: 62013c4f80

Original change: https://android-review.googlesource.com/c/platform/packages/inputmethods/LatinIME/+/1589747

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I15fc9d572d67f9d8aabb699636d18f642f30cd02
main
Treehugger Robot 2021-02-16 19:16:10 +00:00 committed by Automerger Merge Worker
commit 5e1756c5fe
1 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,13 @@ TEST(FormatUtilsTest, TestDetectFormatVersion) {
{ {
const std::vector<uint8_t> buffer = const std::vector<uint8_t> buffer =
getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_2, 0, 0); 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()))); ReadOnlyByteArrayView(buffer.data(), buffer.size())));
} }
{ {
@ -75,7 +81,7 @@ TEST(FormatUtilsTest, TestDetectFormatVersion) {
{ {
const std::vector<uint8_t> buffer = 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( EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion(
ReadOnlyByteArrayView(buffer.data(), buffer.size()))); ReadOnlyByteArrayView(buffer.data(), buffer.size())));
} }
@ -87,7 +93,7 @@ TEST(FormatUtilsTest, TestDetectFormatVersion) {
} }
{ {
const std::vector<uint8_t> buffer = 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( EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion(
ReadOnlyByteArrayView(buffer.data(), buffer.size() - 1))); ReadOnlyByteArrayView(buffer.data(), buffer.size() - 1)));
} }