aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/tests/utils/int_array_view_test.cpp
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-08-06 05:01:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-04 23:56:40 +0000
commit4efa2c0cdbc56ba0a43dc34b42c512941678ae70 (patch)
treefd378f40d7fa25e628faabd197b2e6758385249e /native/jni/tests/utils/int_array_view_test.cpp
parent9273f3832b51f5d23d86df624600381ed6d6585f (diff)
parent9069d30043d5182dfd38465ad9bbc11ad73fab7c (diff)
downloadlatinime-4efa2c0cdbc56ba0a43dc34b42c512941678ae70.tar.gz
latinime-4efa2c0cdbc56ba0a43dc34b42c512941678ae70.tar.xz
latinime-4efa2c0cdbc56ba0a43dc34b42c512941678ae70.zip
Merge "Use IntArrayView to add/remove n-gram entry." into lmp-dev
Diffstat (limited to 'native/jni/tests/utils/int_array_view_test.cpp')
-rw-r--r--native/jni/tests/utils/int_array_view_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/native/jni/tests/utils/int_array_view_test.cpp b/native/jni/tests/utils/int_array_view_test.cpp
index 033b0151c..bd843ab02 100644
--- a/native/jni/tests/utils/int_array_view_test.cpp
+++ b/native/jni/tests/utils/int_array_view_test.cpp
@@ -43,5 +43,19 @@ TEST(IntArrayViewTest, TestIteration) {
EXPECT_EQ(expectedIndex, intArrayView.size());
}
+TEST(IntArrayViewTest, TestConstructFromArray) {
+ const size_t ARRAY_SIZE = 100;
+ int intArray[ARRAY_SIZE];
+ const auto intArrayView = IntArrayView::fromFixedSizeArray(intArray);
+ EXPECT_EQ(ARRAY_SIZE, intArrayView.size());
+}
+
+TEST(IntArrayViewTest, TestConstructFromObject) {
+ const int object = 10;
+ const auto intArrayView = IntArrayView::fromObject(&object);
+ EXPECT_EQ(1, intArrayView.size());
+ EXPECT_EQ(object, intArrayView[0]);
+}
+
} // namespace
} // namespace latinime