From e97b2be0daffe82c2a9fc4c4d60fb16135b40cc8 Mon Sep 17 00:00:00 2001 From: Ningyuan Wang Date: Mon, 10 Apr 2017 16:36:09 -0700 Subject: [PATCH] Add more VTS tests for ISupplicantNetwork This covers the following APIs by adding tests to ISupplicantStaNetwork: ISupplicantNetwork::getInterfaceName(), ISupplicantNetwork::getType() Bug: 33457575 Test: VTS tests pass Change-Id: I9a24195cefefcc23b7603ff33b66a497eba07148 --- .../supplicant_sta_network_hidl_test.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp index aa84e9ac84..0fc591f05f 100644 --- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp +++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp @@ -22,6 +22,7 @@ #include +#include "supplicant_hidl_call_util.h" #include "supplicant_hidl_test_utils.h" using ::android::sp; @@ -30,6 +31,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; +using ::android::hardware::wifi::supplicant::V1_0::IfaceType; using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface; using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork; using ::android::hardware::wifi::supplicant::V1_0:: @@ -137,6 +139,27 @@ TEST_F(SupplicantStaNetworkHidlTest, RegisterCallback) { }); } +/* + * GetInterfaceName + */ +TEST_F(SupplicantStaNetworkHidlTest, GetInterfaceName) { + const auto& status_and_interface_name = + HIDL_INVOKE(sta_network_, getInterfaceName); + EXPECT_EQ(SupplicantStatusCode::SUCCESS, + status_and_interface_name.first.code); + EXPECT_FALSE(std::string(status_and_interface_name.second).empty()); +} + +/* + * GetType + */ +TEST_F(SupplicantStaNetworkHidlTest, GetType) { + const auto& status_and_interface_type = HIDL_INVOKE(sta_network_, getType); + EXPECT_EQ(SupplicantStatusCode::SUCCESS, + status_and_interface_type.first.code); + EXPECT_EQ(status_and_interface_type.second, IfaceType::STA); +} + /* Tests out the various setter/getter methods. */ /* * SetGetSsid