Merge "Added tests for passthrough service lookup."
diff --git a/test/hidl_test_client.cpp b/test/hidl_test_client.cpp
index a46368f..e12fae9 100644
--- a/test/hidl_test_client.cpp
+++ b/test/hidl_test_client.cpp
@@ -481,6 +481,17 @@
// statement can be written here.
}
+TEST_F(HidlTest, PassthroughLookupTest) {
+ // IFoo is special because it returns an interface no matter
+ // what instance name is requested. In general, this is BAD!
+ EXPECT_NE(nullptr, IFoo::getService("", true /* getStub */).get());
+ EXPECT_NE(nullptr, IFoo::getService("a", true /* getStub */).get());
+ EXPECT_NE(nullptr, IFoo::getService("asdf", true /* getStub */).get());
+ EXPECT_NE(nullptr, IFoo::getService("::::::::", true /* getStub */).get());
+ EXPECT_NE(nullptr, IFoo::getService("/////", true /* getStub */).get());
+ EXPECT_NE(nullptr, IFoo::getService("\n", true /* getStub */).get());
+}
+
TEST_F(HidlTest, EnumToStringTest) {
using namespace std::string_literals;
using ::android::hardware::tests::foo::V1_0::toString;