From 1fe4fbf7564c404af9d4818870a9fcd41955372d Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Mon, 22 Jan 2024 23:39:38 +0000 Subject: [PATCH] Update test to be more accurate. --- .../wifi/core/TestAccessPointFactoryLinux.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/unit/linux/wifi/core/TestAccessPointFactoryLinux.cxx b/tests/unit/linux/wifi/core/TestAccessPointFactoryLinux.cxx index 9ba8a9b5..52a44dd4 100644 --- a/tests/unit/linux/wifi/core/TestAccessPointFactoryLinux.cxx +++ b/tests/unit/linux/wifi/core/TestAccessPointFactoryLinux.cxx @@ -50,28 +50,34 @@ TEST_CASE("Create() function", "[wifi][core][ap][linux]") { using namespace Microsoft::Net::Wifi; + using Microsoft::Net::Netlink::Nl80211::Nl80211Interface; + SECTION("Create() doesn't cause a crash") { + auto createArgs = std::make_unique(Nl80211Interface{}); AccessPointFactoryLinux accessPointFactory{ std::make_unique() }; - REQUIRE_NOTHROW(accessPointFactory.Create(Test::InterfaceNameDefault)); + REQUIRE_NOTHROW(accessPointFactory.Create(Test::InterfaceNameDefault, std::move(createArgs))); } SECTION("Create() with empty/null inteface doesn't cause a crash") { + auto createArgs = std::make_unique(Nl80211Interface{}); AccessPointFactoryLinux accessPointFactory{ std::make_unique() }; - REQUIRE_NOTHROW(accessPointFactory.Create({})); + REQUIRE_NOTHROW(accessPointFactory.Create({}, std::move(createArgs))); } SECTION("Create() with valid input arguments returns non-nullptr instance") { + auto createArgs = std::make_unique(Nl80211Interface{}); AccessPointFactoryLinux accessPointFactory{ std::make_unique() }; - REQUIRE(accessPointFactory.Create(Test::InterfaceNameDefault) != nullptr); + REQUIRE(accessPointFactory.Create(Test::InterfaceNameDefault, std::move(createArgs)) != nullptr); } SECTION("Create() instance reflects basic properties from base class") { + auto createArgs = std::make_unique(Nl80211Interface{}); AccessPointFactoryLinux accessPointFactory{ std::make_unique() }; - const auto accessPoint = accessPointFactory.Create(Test::InterfaceNameDefault); + const auto accessPoint = accessPointFactory.Create(Test::InterfaceNameDefault, std::move(createArgs)); REQUIRE(accessPoint->GetInterfaceName() == Test::InterfaceNameDefault); } }