Skip to content

Commit 1fe4fbf

Browse files
committed
Update test to be more accurate.
1 parent ea87cf2 commit 1fe4fbf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/unit/linux/wifi/core/TestAccessPointFactoryLinux.cxx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,34 @@ TEST_CASE("Create() function", "[wifi][core][ap][linux]")
5050
{
5151
using namespace Microsoft::Net::Wifi;
5252

53+
using Microsoft::Net::Netlink::Nl80211::Nl80211Interface;
54+
5355
SECTION("Create() doesn't cause a crash")
5456
{
57+
auto createArgs = std::make_unique<AccessPointCreateArgsLinux>(Nl80211Interface{});
5558
AccessPointFactoryLinux accessPointFactory{ std::make_unique<Test::AccessPointControllerFactoryTest>() };
56-
REQUIRE_NOTHROW(accessPointFactory.Create(Test::InterfaceNameDefault));
59+
REQUIRE_NOTHROW(accessPointFactory.Create(Test::InterfaceNameDefault, std::move(createArgs)));
5760
}
5861

5962
SECTION("Create() with empty/null inteface doesn't cause a crash")
6063
{
64+
auto createArgs = std::make_unique<AccessPointCreateArgsLinux>(Nl80211Interface{});
6165
AccessPointFactoryLinux accessPointFactory{ std::make_unique<Test::AccessPointControllerFactoryTest>() };
62-
REQUIRE_NOTHROW(accessPointFactory.Create({}));
66+
REQUIRE_NOTHROW(accessPointFactory.Create({}, std::move(createArgs)));
6367
}
6468

6569
SECTION("Create() with valid input arguments returns non-nullptr instance")
6670
{
71+
auto createArgs = std::make_unique<AccessPointCreateArgsLinux>(Nl80211Interface{});
6772
AccessPointFactoryLinux accessPointFactory{ std::make_unique<Test::AccessPointControllerFactoryTest>() };
68-
REQUIRE(accessPointFactory.Create(Test::InterfaceNameDefault) != nullptr);
73+
REQUIRE(accessPointFactory.Create(Test::InterfaceNameDefault, std::move(createArgs)) != nullptr);
6974
}
7075

7176
SECTION("Create() instance reflects basic properties from base class")
7277
{
78+
auto createArgs = std::make_unique<AccessPointCreateArgsLinux>(Nl80211Interface{});
7379
AccessPointFactoryLinux accessPointFactory{ std::make_unique<Test::AccessPointControllerFactoryTest>() };
74-
const auto accessPoint = accessPointFactory.Create(Test::InterfaceNameDefault);
80+
const auto accessPoint = accessPointFactory.Create(Test::InterfaceNameDefault, std::move(createArgs));
7581
REQUIRE(accessPoint->GetInterfaceName() == Test::InterfaceNameDefault);
7682
}
7783
}

0 commit comments

Comments
 (0)