summaryrefslogtreecommitdiff
path: root/selftest.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <[email protected]>2017-03-17 19:16:34 -0700
committerAdam Ierymenko <[email protected]>2017-03-17 19:16:34 -0700
commitec8e1178e5cfbe9cd790928dd06562af734a2d48 (patch)
tree66219559ff96a1594b1c5821fb1bfc67ae7b36ec /selftest.cpp
parent4f3f471b4c7726b9ac66304788613c3c12e09d12 (diff)
Version bumps, and fix Debian so default is to build normally and .static files are used in our builds.
Diffstat (limited to 'selftest.cpp')
-rw-r--r--selftest.cpp26
1 files changed, 26 insertions, 0 deletions
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<uint64_t,std::string> ht;