Updated core for tptr support

This commit is contained in:
Joseph Henry
2017-03-28 18:56:38 -07:00
parent b1e83a236e
commit bd3b07e00a
68 changed files with 1271 additions and 2033 deletions

View File

@@ -582,8 +582,34 @@ static int testPacket()
return 0;
}
static void _testExcept(int &depth)
{
if (depth >= 16) {
throw std::runtime_error("LOL!");
} else {
++depth;
_testExcept(depth);
}
}
static int testOther()
{
std::cout << "[other] Testing C++ exceptions... "; std::cout.flush();
int depth = 0;
try {
_testExcept(depth);
} catch (std::runtime_error &e) {
if (depth == 16) {
std::cout << "OK" << std::endl;
} else {
std::cout << "ERROR (depth not 16)" << std::endl;
return -1;
}
} catch ( ... ) {
std::cout << "ERROR (exception not std::runtime_error)" << std::endl;
return -1;
}
std::cout << "[other] Testing Hashtable... "; std::cout.flush();
{
Hashtable<uint64_t,std::string> ht;