Clenup after Database test

- Close the DB before trying to remove it
 - Removed a few line in TODO.txt
This commit is contained in:
Sébastien Rombauts 2014-03-09 08:53:53 +01:00
parent 6d8b808320
commit 24bca5a215
2 changed files with 12 additions and 20 deletions

View File

@ -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

View File

@ -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));
} }