summaryrefslogtreecommitdiff
path: root/test_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test_main.cpp')
-rw-r--r--test_main.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/test_main.cpp b/test_main.cpp
index 0de46ec..2b9f52c 100644
--- a/test_main.cpp
+++ b/test_main.cpp
@@ -17,7 +17,7 @@
#define LOG_TAG "LibHidlTest"
#include <android-base/logging.h>
-#include <android/hardware/tests/inheritance/1.0/IParent.h>
+#include <android/hidl/memory/1.0/IMemory.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <hidl/HidlSupport.h>
@@ -280,6 +280,21 @@ TEST_F(LibHidlTest, VecEqTest) {
EXPECT_TRUE(hv1 != hv3);
}
+TEST_F(LibHidlTest, VecEqInitializerTest) {
+ std::vector<int32_t> reference{5, 6, 7};
+ android::hardware::hidl_vec<int32_t> hv1{1, 2, 3};
+ hv1 = {5, 6, 7};
+ android::hardware::hidl_vec<int32_t> hv2;
+ hv2 = {5, 6, 7};
+ android::hardware::hidl_vec<int32_t> hv3;
+ hv3 = {5, 6, 8};
+
+ // use the == and != operator intentionally here
+ EXPECT_TRUE(hv1 == hv2);
+ EXPECT_TRUE(hv1 == reference);
+ EXPECT_TRUE(hv1 != hv3);
+}
+
TEST_F(LibHidlTest, VecRangeCtorTest) {
struct ConvertibleType {
int val;
@@ -390,12 +405,15 @@ TEST_F(LibHidlTest, HidlVersionTest) {
hidl_version v3_0b{3,0};
EXPECT_TRUE(v1_0 < v2_0);
+ EXPECT_TRUE(v1_0 != v2_0);
EXPECT_TRUE(v2_0 < v2_1);
EXPECT_TRUE(v2_1 < v3_0);
EXPECT_TRUE(v2_0 > v1_0);
+ EXPECT_TRUE(v2_0 != v1_0);
EXPECT_TRUE(v2_1 > v2_0);
EXPECT_TRUE(v3_0 > v2_1);
EXPECT_TRUE(v3_0 == v3_0b);
+ EXPECT_FALSE(v3_0 != v3_0b);
EXPECT_TRUE(v3_0 <= v3_0b);
EXPECT_TRUE(v2_2 <= v3_0);
EXPECT_TRUE(v3_0 >= v3_0b);
@@ -459,12 +477,14 @@ TEST_F(LibHidlTest, StatusStringTest) {
TEST_F(LibHidlTest, PreloadTest) {
using ::android::hardware::preloadPassthroughService;
- using ::android::hardware::tests::inheritance::V1_0::IParent;
+ using ::android::hidl::memory::V1_0::IMemory;
- static const std::string kLib = "android.hardware.tests.inheritance@1.0-impl.so";
+ // installed on all devices by default in both bitnesses and not otherwise a dependency of this
+ // test.
+ static const std::string kLib = "android.hidl.memory@1.0-impl.so";
EXPECT_FALSE(isLibraryOpen(kLib));
- preloadPassthroughService<IParent>();
+ preloadPassthroughService<IMemory>();
EXPECT_TRUE(isLibraryOpen(kLib));
}