summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkInterfaceEnum.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-11 22:20:04 +0200
committerMattes D <github@xoft.cz>2015-06-11 22:20:04 +0200
commitd390214929f4b280cc66cdbc170694ec9b1fa8c4 (patch)
tree3c49c75771ffd8931f47b895b2bd31014f7885d8 /src/OSSupport/NetworkInterfaceEnum.cpp
parentMerge pull request #2162 from lkolbly/master (diff)
downloadcuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.gz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.bz2
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.lz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.xz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.zst
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.zip
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;