nimbuscontrols / EIPScanner

Free implementation of EtherNet/IP in C++
https://eipscanner.readthedocs.io/en/latest/
MIT License
238 stars 98 forks source link

DiscoveryManager: move macro and fix Windows test #76

Closed JohannesKauffmann closed 2 years ago

JohannesKauffmann commented 2 years ago

The DiscoveryManager testcase mocks the Receive() function to throw an exception, however, the error code is different on Windows vs Linux. Thus, when running this test on Windows, it fails:

[----------] 1 test from TestDiscoveryManager
[ RUN      ] TestDiscoveryManager.ShouldSendBroadcastMesasageAndGetResponses
unknown file: Failure
C++ exception with description "Resource temporarily unavailable" thrown in the test body.
unknown file: Failure
C++ exception with description "Resource temporarily unavailable" thrown in the test body.
[  FAILED  ] TestDiscoveryManager.ShouldSendBroadcastMesasageAndGetResponses (2 ms)
[----------] 1 test from TestDiscoveryManager (2 ms total)

The difference in error codes between Windows and Linux has been accounted for in the DiscoveryManager itself since 5c0cd06, but the test was still broken on Windows.

Also fixed a spelling mistake.