summaryrefslogtreecommitdiff
path: root/selftest.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-11-18 11:09:19 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-11-18 11:09:19 -0800
commitab4021dd0ee37af0af4137dc772911ea8ec52bb2 (patch)
treeddafd96c7f07e8cc540cfeb08f09664999eef554 /selftest.cpp
parent1fcbb1fbedad2d0aff567a0dda84a0985ba063cb (diff)
downloadinfinitytier-ab4021dd0ee37af0af4137dc772911ea8ec52bb2.tar.gz
infinitytier-ab4021dd0ee37af0af4137dc772911ea8ec52bb2.zip
Do packet MAC check before locallyValidate(), and add timing measurement in selftest.
Diffstat (limited to 'selftest.cpp')
-rw-r--r--selftest.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/selftest.cpp b/selftest.cpp
index 7ca4ac3b..9992d757 100644
--- a/selftest.cpp
+++ b/selftest.cpp
@@ -376,11 +376,15 @@ static int testIdentity()
std::cout << "FAIL (1)" << std::endl;
return -1;
}
- if (!id.locallyValidate()) {
- std::cout << "FAIL (2)" << std::endl;
- return -1;
+ const uint64_t vst = OSUtils::now();
+ for(int k=0;k<10;++k) {
+ if (!id.locallyValidate()) {
+ std::cout << "FAIL (2)" << std::endl;
+ return -1;
+ }
}
- std::cout << "PASS" << std::endl;
+ const uint64_t vet = OSUtils::now();
+ std::cout << "PASS (" << ((double)(vet - vst) / 10.0) << "ms per validation)" << std::endl;
std::cout << "[identity] Validate known-bad identity... "; std::cout.flush();
if (!id.fromString(KNOWN_BAD_IDENTITY)) {