mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Add test for constructor consistency
This commit is contained in:
parent
67ac88fb1e
commit
b2f059e188
@ -13,6 +13,8 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user