MCPcopy Create free account
hub / github.com/Beckhoff/ADS / testAmsRouterSetLocalAddress

Method testAmsRouterSetLocalAddress

AdsLibTest/main.cpp:158–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 }
157
158 void testAmsRouterSetLocalAddress(const std::string &)
159 {
160 const AmsNetId newNetId{ 1, 2, 3, 4, 5, 6 };
161 AmsRouter testee;
162 AmsAddr changed;
163 AmsAddr empty;
164
165 const auto port = testee.OpenPort();
166 fructose_assert(0 == testee.GetLocalAddress(port, &empty));
167 fructose_assert(!empty.netId);
168
169 testee.SetLocalAddress(newNetId);
170 fructose_assert(0 == testee.GetLocalAddress(port, &changed));
171 fructose_assert(0 == memcmp(&newNetId, &changed.netId,
172 sizeof(newNetId)));
173 fructose_assert(port == changed.port);
174 }
175
176 void testConcurrentRoutes(const std::string &)
177 {

Callers

nothing calls this directly

Calls 3

OpenPortMethod · 0.80
GetLocalAddressMethod · 0.80
SetLocalAddressMethod · 0.80

Tested by

no test coverage detected