operator== and != for hidl_vec.
Test: libhidl_test
Bug: 32834072
Change-Id: Iae9b454f5c1e9d8b3b10394ef6de9d4ba4cdd959
diff --git a/test_main.cpp b/test_main.cpp
index ca5d017..bdf4b49 100644
--- a/test_main.cpp
+++ b/test_main.cpp
@@ -189,6 +189,16 @@
EXPECT_EQ(sum, 15+16+17);
}
+TEST_F(LibHidlTest, VecEqTest) {
+ android::hardware::hidl_vec<int32_t> hv1{5, 6, 7};
+ android::hardware::hidl_vec<int32_t> hv2{5, 6, 7};
+ android::hardware::hidl_vec<int32_t> hv3{5, 6, 8};
+
+ // use the == and != operator intentionally here
+ EXPECT_TRUE(hv1 == hv2);
+ EXPECT_TRUE(hv1 != hv3);
+}
+
TEST_F(LibHidlTest, ArrayTest) {
using android::hardware::hidl_array;
int32_t array[] = {5, 6, 7};