diff options
author | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-21 13:07:22 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-21 13:07:22 -0800 |
commit | 370dd6c4da6acff85947cef365e4df48c00d0863 (patch) | |
tree | 96dd0db7a3fcecb6354276ed23c6274c5b7804d7 /selftest.cpp | |
parent | 06ca24e8e2b663842fee7daabac4a2652da5a834 (diff) | |
download | infinitytier-370dd6c4da6acff85947cef365e4df48c00d0863.tar.gz infinitytier-370dd6c4da6acff85947cef365e4df48c00d0863.zip |
Several things:
(1) Add a bunch of tedious type casts to eliminate unnecessary compiler warnings on Windows X64 builds.
(2) Some EthernetTap work to integrate Windows custom IOCTL for multicast group lookup (not done quite yet).
(3) Dump some more info in selftest to make sure our Windows path lookup functions are returning sane results.
Diffstat (limited to 'selftest.cpp')
-rw-r--r-- | selftest.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/selftest.cpp b/selftest.cpp index 66e1b75e..5c96277f 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -53,6 +53,8 @@ #include "node/Poly1305.hpp" #include "node/CertificateOfMembership.hpp" #include "node/HttpClient.hpp" +#include "node/Defaults.hpp" +#include "node/Node.hpp" #ifdef __WINDOWS__ #include <tchar.h> @@ -70,7 +72,7 @@ static void testHttpHandler(void *arg,int code,const std::string &url,bool onDis { unsigned char sha[64]; if (code == 200) { - SHA512::hash(sha,body.data(),body.length()); + SHA512::hash(sha,body.data(),(unsigned int)body.length()); if (webSha512ShouldBe == Utils::hex(sha,64)) std::cout << "got " << body.length() << " bytes, response code " << code << ", SHA-512 OK" << std::endl; else std::cout << "got " << body.length() << " bytes, response code " << code << ", SHA-512 FAILED!" << std::endl; @@ -129,7 +131,7 @@ static int testCrypto() } std::cout << "[crypto] Testing SHA-512... "; std::cout.flush(); - SHA512::hash(buf1,sha512TV0Input,strlen(sha512TV0Input)); + SHA512::hash(buf1,sha512TV0Input,(unsigned int)strlen(sha512TV0Input)); if (memcmp(buf1,sha512TV0Digest,64)) { std::cout << "FAIL" << std::endl; return -1; @@ -465,7 +467,7 @@ static int testPacket() a.reset(Address(),Address(),Packet::VERB_HELLO); for(int i=0;i<32;++i) - a.append("supercalifragilisticexpealidocious",strlen("supercalifragilisticexpealidocious")); + a.append("supercalifragilisticexpealidocious",(unsigned int)strlen("supercalifragilisticexpealidocious")); b = a; if (a != b) { @@ -504,7 +506,7 @@ static int testOther() if ((dec.length() != flen)||(memcmp(dec.data(),fuzzbuf,dec.length()))) { std::cout << "FAILED!" << std::endl; std::cout << Utils::hex(fuzzbuf,flen) << std::endl; - std::cout << Utils::hex(dec.data(),dec.length()) << std::endl; + std::cout << Utils::hex(dec.data(),(unsigned int)dec.length()) << std::endl; return -1; } } @@ -614,6 +616,9 @@ int main(int argc,char **argv) */ std::cout << "[info] sizeof(void *) == " << sizeof(void *) << std::endl; + std::cout << "[info] default home: " << ZT_DEFAULTS.defaultHomePath << std::endl; + std::cout << "[info] system authtoken.secret: " << Node::LocalClient::authTokenDefaultSystemPath() << std::endl; + std::cout << "[info] user authtoken.secret: " << Node::LocalClient::authTokenDefaultUserPath() << std::endl; srand((unsigned int)time(0)); |