summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkInterfaceEnum.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/OSSupport/NetworkInterfaceEnum.cpp')
-rw-r--r--src/OSSupport/NetworkInterfaceEnum.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/OSSupport/NetworkInterfaceEnum.cpp b/src/OSSupport/NetworkInterfaceEnum.cpp
index c4af1e93c..d74565e07 100644
--- a/src/OSSupport/NetworkInterfaceEnum.cpp
+++ b/src/OSSupport/NetworkInterfaceEnum.cpp
@@ -6,6 +6,8 @@
#include "Globals.h"
#include "Network.h"
#include "event2/util.h"
+#include "../SelfTests.h"
+
#ifdef _WIN32
#include <IPHlpApi.h>
#pragma comment(lib, "IPHLPAPI.lib")
@@ -27,13 +29,18 @@ static class cEnumIPAddressTest
public:
cEnumIPAddressTest(void)
{
- printf("Enumerating all IP addresses...\n");
+ cSelfTests::Get().Register(std::function<void(void)>(&Test), "Network IP enumeration");
+ }
+
+ static void Test(void)
+ {
+ LOG("Enumerating all IP addresses...");
auto IPs = cNetwork::EnumLocalIPAddresses();
for (auto & ip: IPs)
{
- printf(" %s\n", ip.c_str());
+ LOG(" %s", ip.c_str());
}
- printf("Done.\n");
+ LOG("Done.");
}
} g_EnumIPAddressTest;