summaryrefslogtreecommitdiff
path: root/selftest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'selftest.cpp')
-rw-r--r--selftest.cpp52
1 files changed, 3 insertions, 49 deletions
diff --git a/selftest.cpp b/selftest.cpp
index 4008cd2a..77c06cc0 100644
--- a/selftest.cpp
+++ b/selftest.cpp
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2018 ZeroTier, Inc. https://www.zerotier.com/
+ * Copyright (C) 2011-2019 ZeroTier, Inc. https://www.zerotier.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --
*
@@ -670,52 +670,6 @@ static int testOther()
std::cout << std::endl;
#if 0
- std::cout << "[other] Benchmarking memcpy... "; std::cout.flush();
- {
- unsigned char *bb = (unsigned char *)::malloc(1234567);
- unsigned char *cc = (unsigned char *)::malloc(1234567);
- for(unsigned int i=0;i<1234567;++i)
- bb[i] = (unsigned char)i;
- double bytes = 0.0;
- uint64_t start = OSUtils::now();
- for(unsigned int i=0;i<20000;++i) {
- ++bb[i];
- ++bb[i+1];
- memcpy(cc,bb,1234567);
- bytes += 1234567.0;
- }
- if (cc[0] != bb[0])
- abort();
- uint64_t end = OSUtils::now();
- std::cout << ((bytes / 1048576.0) / ((long double)(end - start) / 1024.0)) << " MiB/second" << std::endl;
- ::free((void *)bb);
- ::free((void *)cc);
- }
-#endif
-
- std::cout << "[other] Benchmarking ZT_FAST_MEMCPY... "; std::cout.flush();
- {
- unsigned char *bb = (unsigned char *)::malloc(1234567);
- unsigned char *cc = (unsigned char *)::malloc(1234567);
- for(unsigned int i=0;i<1234567;++i)
- bb[i] = (unsigned char)i;
- double bytes = 0.0;
- uint64_t start = OSUtils::now();
- for(unsigned int i=0;i<20000;++i) {
- ++bb[0];
- ++bb[1234566];
- ZT_FAST_MEMCPY(cc,bb,1234567);
- bytes += 1234567.0;
- }
- if (cc[0] != bb[0])
- abort();
- uint64_t end = OSUtils::now();
- std::cout << ((bytes / 1048576.0) / ((long double)(end - start) / 1024.0)) << " MiB/second" << std::endl;
- ::free((void *)bb);
- ::free((void *)cc);
- }
-
-#if 0
std::cout << "[other] Testing Hashtable... "; std::cout.flush();
{
Hashtable<uint64_t,std::string> ht;
@@ -999,7 +953,7 @@ struct TestPhyHandlers
inline void phyOnUnixAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN) {}
inline void phyOnUnixClose(PhySocket *sock,void **uptr) {}
inline void phyOnUnixData(PhySocket *sock,void **uptr,void *data,unsigned long len) {}
- inline void phyOnUnixWritable(PhySocket *sock,void **uptr,bool b) {}
+ inline void phyOnUnixWritable(PhySocket *sock,void **uptr) {}
#endif // __UNIX_LIKE__
inline void phyOnFileDescriptorActivity(PhySocket *sock,void **uptr,bool readable,bool writable) {}