diff --git a/tests/Exception_test.cpp b/tests/Exception_test.cpp index 621c9c8..9a71c10 100644 --- a/tests/Exception_test.cpp +++ b/tests/Exception_test.cpp @@ -13,6 +13,8 @@ #include +#include + TEST(Exception, copy) { const SQLite::Exception ex1("some error", 2); const SQLite::Exception ex2 = ex1; @@ -42,3 +44,19 @@ TEST(Exception, throw_catch) { EXPECT_STREQ(ex.what(), message); } } + + +TEST(Exception, constructor) { + const char msg1[] = "error msg"; + std::string msg2 = msg1; + { + const SQLite::Exception ex1(msg1); + const SQLite::Exception ex2(msg2); + EXPECT_STREQ(ex1.what(), ex2.what()); + } + { + const SQLite::Exception ex1(msg1, 1); + const SQLite::Exception ex2(msg2, 1); + EXPECT_STREQ(ex1.what(), ex2.what()); + } +}