mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Clenup after Database test
- Close the DB before trying to remove it - Removed a few line in TODO.txt
This commit is contained in:
parent
6d8b808320
commit
24bca5a215
5
TODO.txt
5
TODO.txt
@ -1,10 +1,5 @@
|
|||||||
Add a full googletest suite
|
Add a full googletest suite
|
||||||
|
|
||||||
Create a "SQLiteCppExample" repository using the wrapper as a Git submodule.
|
|
||||||
|
|
||||||
Check C++11 explicit support
|
|
||||||
|
|
||||||
Add a FAQ.txt
|
|
||||||
Add a Tutorial: for SQLite newbies
|
Add a Tutorial: for SQLite newbies
|
||||||
Create Github Wiki pages with the README.md and FAQ.txt: Installation, Examples, Tutorial, How to contribute
|
Create Github Wiki pages with the README.md and FAQ.txt: Installation, Examples, Tutorial, How to contribute
|
||||||
|
|
||||||
|
@ -30,21 +30,18 @@ void assertion_failed(const char* apFile, const long apLine, const char* apFunc,
|
|||||||
// Constructor
|
// Constructor
|
||||||
TEST(Database, ctor) {
|
TEST(Database, ctor) {
|
||||||
remove("test.db3");
|
remove("test.db3");
|
||||||
|
{
|
||||||
EXPECT_THROW(SQLite::Database absent("test.db3"), SQLite::Exception);
|
EXPECT_THROW(SQLite::Database absent("test.db3"), SQLite::Exception);
|
||||||
SQLite::Database db("test.db3", SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
|
SQLite::Database db("test.db3", SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
|
||||||
EXPECT_STREQ("test.db3", db.getFilename().c_str());
|
EXPECT_STREQ("test.db3", db.getFilename().c_str());
|
||||||
EXPECT_FALSE(db.tableExists("test"));
|
EXPECT_FALSE(db.tableExists("test"));
|
||||||
EXPECT_FALSE(db.tableExists(std::string("test")));
|
EXPECT_FALSE(db.tableExists(std::string("test")));
|
||||||
EXPECT_EQ(0, db.getLastInsertRowid());
|
EXPECT_EQ(0, db.getLastInsertRowid());
|
||||||
EXPECT_EQ(0, db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)"));
|
EXPECT_EQ(0, db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)"));
|
||||||
EXPECT_TRUE(db.tableExists("test"));
|
EXPECT_TRUE(db.tableExists("test"));
|
||||||
EXPECT_TRUE(db.tableExists(std::string("test")));
|
EXPECT_TRUE(db.tableExists(std::string("test")));
|
||||||
EXPECT_EQ(0, db.getLastInsertRowid());
|
EXPECT_EQ(0, db.getLastInsertRowid());
|
||||||
|
} // Close DB test.db3
|
||||||
remove("test.db3");
|
remove("test.db3");
|
||||||
|
|
||||||
// TODO test
|
|
||||||
// EXPECT_FALSE(db.hasEntity(entity1));
|
|
||||||
// EXPECT_EQ((size_t)0, db.unregisterEntity(entity1));
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user