diff options
author | Alexander Harkness <me@bearbin.net> | 2015-06-12 12:00:47 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2015-06-12 12:00:47 +0200 |
commit | 001305247fa28e78d0f3d9d565ff7aff25864edc (patch) | |
tree | 9f1e41fa0e6afee7ce9f90f3778f02e7a770ebf7 /src/OSSupport | |
parent | Update gratipay (diff) | |
parent | SelfTests are registered and executed after logging framework init. (diff) | |
download | cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.gz cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.bz2 cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.lz cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.xz cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.zst cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.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; |