mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 10:05:19 +00:00
Merge "[WIFI] Restore initialization code"
am: 8f4416aabb
Change-Id: I9f0f828d542e337f185c4a423748f57ef53a00ce
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
cc_library_static {
|
||||
name: "VtsHalWifiV1_0TargetTestUtil",
|
||||
srcs: [
|
||||
"VtsHalWifiV1_0TargetTest.cpp",
|
||||
|
||||
"wifi_hidl_call_util_selftest.cpp",
|
||||
"wifi_hidl_test.cpp",
|
||||
"wifi_hidl_test_utils.cpp"],
|
||||
@@ -38,6 +38,7 @@ cc_test {
|
||||
name: "VtsHalWifiV1_0TargetTest",
|
||||
defaults: ["hidl_defaults"],
|
||||
srcs: [
|
||||
"VtsHalWifiV1_0TargetTest.cpp",
|
||||
"wifi_ap_iface_hidl_test.cpp",
|
||||
"wifi_chip_hidl_test.cpp",
|
||||
"wifi_p2p_iface_hidl_test.cpp",
|
||||
@@ -63,7 +64,9 @@ cc_test {
|
||||
cc_test {
|
||||
name: "VtsHalWifiNanV1_0TargetTest",
|
||||
defaults: ["hidl_defaults"],
|
||||
srcs: ["wifi_nan_iface_hidl_test.cpp"],
|
||||
srcs: [
|
||||
"VtsHalWifiV1_0TargetTest.cpp",
|
||||
"wifi_nan_iface_hidl_test.cpp"],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"liblog",
|
||||
|
||||
@@ -20,14 +20,6 @@
|
||||
|
||||
#include "wifi_hidl_test_utils.h"
|
||||
|
||||
class WifiHidlEnvironment : public ::testing::Environment {
|
||||
public:
|
||||
virtual void SetUp() override { stopFramework(); }
|
||||
virtual void TearDown() override { startFramework(); }
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
|
||||
@@ -82,14 +82,6 @@ bool configureChipToSupportIfaceTypeInternal(const sp<IWifiChip>& wifi_chip,
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void stopFramework() {
|
||||
ASSERT_EQ(std::system("stop"), 0);
|
||||
stopWifi();
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
void startFramework() { ASSERT_EQ(std::system("start"), 0); }
|
||||
|
||||
sp<IWifi> getWifi() {
|
||||
sp<IWifi> wifi = ::testing::VtsHalHidlTargetTestBase::getService<IWifi>();
|
||||
return wifi;
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
#include <android/hardware/wifi/1.0/IWifiRttController.h>
|
||||
#include <android/hardware/wifi/1.0/IWifiStaIface.h>
|
||||
|
||||
// Used to stop the android framework (wifi service) before every
|
||||
// test.
|
||||
void stopFramework();
|
||||
void startFramework();
|
||||
|
||||
// Helper functions to obtain references to the various HIDL interface objects.
|
||||
// Note: We only have a single instance of each of these objects currently.
|
||||
// These helper functions should be modified to return vectors if we support
|
||||
@@ -49,3 +44,12 @@ bool configureChipToSupportIfaceType(
|
||||
android::hardware::wifi::V1_0::ChipModeId* configured_mode_id);
|
||||
// Used to trigger IWifi.stop() at the end of every test.
|
||||
void stopWifi();
|
||||
|
||||
class WifiHidlEnvironment : public ::testing::Environment {
|
||||
public:
|
||||
virtual void SetUp() override {
|
||||
stopWifi();
|
||||
sleep(5);
|
||||
}
|
||||
virtual void TearDown() override {}
|
||||
};
|
||||
Reference in New Issue
Block a user