diff options
Diffstat (limited to 'vespalib/src/tests/exception_classes')
-rw-r--r-- | vespalib/src/tests/exception_classes/exception_classes_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vespalib/src/tests/exception_classes/exception_classes_test.cpp b/vespalib/src/tests/exception_classes/exception_classes_test.cpp index f9413970281..946c3fa32e4 100644 --- a/vespalib/src/tests/exception_classes/exception_classes_test.cpp +++ b/vespalib/src/tests/exception_classes/exception_classes_test.cpp @@ -33,4 +33,17 @@ TEST("require that PortListenException with cause retains relevant information") } } +TEST("test that OOMException carries message forward.") { + const char * M = "This is the simple message."; + bool caught(false); + try { + throw OOMException(M); + ASSERT_TRUE(false); + } catch (OOMException & e) { + EXPECT_EQUAL(0, strcmp(M, e.what())); + caught = true; + } + EXPECT_TRUE(caught); +} + TEST_MAIN() { TEST_RUN_ALL(); } |