From ec8e1178e5cfbe9cd790928dd06562af734a2d48 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 17 Mar 2017 19:16:34 -0700 Subject: Version bumps, and fix Debian so default is to build normally and .static files are used in our builds. --- selftest.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'selftest.cpp') diff --git a/selftest.cpp b/selftest.cpp index 8a450796..48625d53 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -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 ht; -- cgit v1.2.3