aboutsummaryrefslogtreecommitdiffstats
path: root/test/base/database.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/base/database.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/base/database.cpp b/test/base/database.cpp
index fdf4a3dd..72b44094 100644
--- a/test/base/database.cpp
+++ b/test/base/database.cpp
@@ -43,6 +43,9 @@ namespace usdx
CPPUNIT_TEST(testFormatDate);
CPPUNIT_TEST(testTableExists);
CPPUNIT_TEST(testTableNotExists);
+ CPPUNIT_TEST(testTableColumnExists);
+ CPPUNIT_TEST(testTableColumnNotExists);
+ CPPUNIT_TEST(testTableColumnTableNotExists);
CPPUNIT_TEST_SUITE_END();
private:
StatDatabase *db;
@@ -102,6 +105,21 @@ namespace usdx
{
CPPUNIT_ASSERT( false == StatDatabase::get_instance()->sqlite_table_exists("abc") );
}
+
+ void testTableColumnExists()
+ {
+ CPPUNIT_ASSERT( true == StatDatabase::get_instance()->sqlite_table_contains_column("us_songs", "Title") );
+ }
+
+ void testTableColumnNotExists()
+ {
+ CPPUNIT_ASSERT( false == StatDatabase::get_instance()->sqlite_table_contains_column("us_songs", "title") );
+ }
+
+ void testTableColumnTableNotExists()
+ {
+ CPPUNIT_ASSERT( false == StatDatabase::get_instance()->sqlite_table_contains_column("abc", "Title") );
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(StatDatabaseTest);