aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/base/database.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/base/database.cpp b/test/base/database.cpp
index 5738c56c..fdf4a3dd 100644
--- a/test/base/database.cpp
+++ b/test/base/database.cpp
@@ -41,6 +41,8 @@ namespace usdx
CPPUNIT_TEST(testSizeOfTime_t);
CPPUNIT_TEST(testGetStatReset);
CPPUNIT_TEST(testFormatDate);
+ CPPUNIT_TEST(testTableExists);
+ CPPUNIT_TEST(testTableNotExists);
CPPUNIT_TEST_SUITE_END();
private:
StatDatabase *db;
@@ -90,6 +92,16 @@ namespace usdx
StatDatabase::get_instance()->format_date(buf, 9, 1262433600);
CPPUNIT_ASSERT( strcmp(buf, "13.02.09") );
}
+
+ void testTableExists()
+ {
+ CPPUNIT_ASSERT( true == StatDatabase::get_instance()->sqlite_table_exists("us_songs") );
+ }
+
+ void testTableNotExists()
+ {
+ CPPUNIT_ASSERT( false == StatDatabase::get_instance()->sqlite_table_exists("abc") );
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(StatDatabaseTest);