diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-10 21:46:58 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:44 +0100 |
commit | 872459a7cc525eb87a2dc5a82f1b137493186080 (patch) | |
tree | 594be565ed9bcc2243ac6fdfbcf7424b0cf3eb95 /test | |
parent | e2d74a920c3d6a8250d3b3e2f08d9f29f6d6cea7 (diff) | |
download | usdx-872459a7cc525eb87a2dc5a82f1b137493186080.tar.gz usdx-872459a7cc525eb87a2dc5a82f1b137493186080.tar.xz usdx-872459a7cc525eb87a2dc5a82f1b137493186080.zip |
added function for testing if table exists in database
Diffstat (limited to 'test')
-rw-r--r-- | test/base/database.cpp | 12 |
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); |