diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/dicttoolkit/Android.bp | 9 | ||||
-rw-r--r-- | native/jni/Android.bp | 13 | ||||
-rw-r--r-- | native/jni/tests/dictionary/utils/format_utils_test.cpp | 12 |
3 files changed, 30 insertions, 4 deletions
diff --git a/native/dicttoolkit/Android.bp b/native/dicttoolkit/Android.bp index fd35697c1..4ae250fa2 100644 --- a/native/dicttoolkit/Android.bp +++ b/native/dicttoolkit/Android.bp @@ -12,6 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "packages_inputmethods_LatinIME_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["packages_inputmethods_LatinIME_license"], +} + cc_defaults { name: "dicttoolkit_defaults", diff --git a/native/jni/Android.bp b/native/jni/Android.bp index 7419ed1fe..ab14632f8 100644 --- a/native/jni/Android.bp +++ b/native/jni/Android.bp @@ -12,6 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "packages_inputmethods_LatinIME_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["packages_inputmethods_LatinIME_license"], +} + filegroup { name: "LATIN_IME_CORE_SRC_FILES", srcs: [ @@ -179,7 +188,9 @@ cc_library_static { cc_test { name: "liblatinime_unittests", host_supported: true, - + test_options: { + unit_test: true, + }, cflags: [ "-Wno-unused-parameter", "-Wno-unused-function", 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))); } |