diff options
author | Mattes D <github@xoft.cz> | 2015-06-11 22:20:04 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-06-11 22:20:04 +0200 |
commit | d390214929f4b280cc66cdbc170694ec9b1fa8c4 (patch) | |
tree | 3c49c75771ffd8931f47b895b2bd31014f7885d8 /src/OSSupport/NetworkInterfaceEnum.cpp | |
parent | Merge pull request #2162 from lkolbly/master (diff) | |
download | cuberite-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 '')
-rw-r--r-- | src/OSSupport/NetworkInterfaceEnum.cpp | 13 |
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; |