diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-10 21:47:42 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:44 +0100 |
commit | 98bdc2079442b79780db04bb8d05a2c329577e10 (patch) | |
tree | 22438186f1287101ad057e620386cbc96dc4637e /test/base | |
parent | 872459a7cc525eb87a2dc5a82f1b137493186080 (diff) | |
download | usdx-98bdc2079442b79780db04bb8d05a2c329577e10.tar.gz usdx-98bdc2079442b79780db04bb8d05a2c329577e10.tar.xz usdx-98bdc2079442b79780db04bb8d05a2c329577e10.zip |
added function for testing weather a table contains a column or not
Diffstat (limited to 'test/base')
-rw-r--r-- | test/base/database.cpp | 18 |
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); |