aboutsummaryrefslogtreecommitdiffstats
path: root/test/base/songloading.cpp
diff options
context:
space:
mode:
authorRobin Nehls <nehls@mi.fu-berlin.de>2010-01-22 18:55:14 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:45 +0100
commit3a8686408b5b06e45b233c8acdf8fc23e9e5a4eb (patch)
tree9197aaee4eeb4dffa18ea5a7e4ceaaf2230195a4 /test/base/songloading.cpp
parentc2b751f45721e9dabe5c1dc59a536cb537aaa9b5 (diff)
downloadusdx-3a8686408b5b06e45b233c8acdf8fc23e9e5a4eb.tar.gz
usdx-3a8686408b5b06e45b233c8acdf8fc23e9e5a4eb.tar.xz
usdx-3a8686408b5b06e45b233c8acdf8fc23e9e5a4eb.zip
Added exeptiontests for songs with missing required headerfields.
Diffstat (limited to 'test/base/songloading.cpp')
-rw-r--r--test/base/songloading.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/base/songloading.cpp b/test/base/songloading.cpp
index 8c17d64a..b0eae877 100644
--- a/test/base/songloading.cpp
+++ b/test/base/songloading.cpp
@@ -35,6 +35,10 @@ namespace usdx
class SongloadingTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(SongloadingTest);
CPPUNIT_TEST(testSongloadingTxtHeader);
+ CPPUNIT_TEST_EXCEPTION(testSongloadingTxtMissingHeaderFieldArtist, MissingSongTagException);
+ CPPUNIT_TEST_EXCEPTION(testSongloadingTxtMissingHeaderFieldTitle, MissingSongTagException);
+ CPPUNIT_TEST_EXCEPTION(testSongloadingTxtMissingHeaderFieldMp3, MissingSongTagException);
+ CPPUNIT_TEST_EXCEPTION(testSongloadingTxtMissingHeaderFieldBpm, MissingSongTagException);
CPPUNIT_TEST_SUITE_END();
private:
@@ -82,6 +86,53 @@ namespace usdx
delete song;
}
+
+ void testSongloadingTxtMissingHeaderFieldArtist()
+ {
+ // disable logging to avoid logmsgs when the exeption
+ // is thrown
+ using namespace log4cxx;
+ Logger::getRootLogger()->setLevel(Level::getOff());
+
+ Songloader::get_instance()->
+ load_header("testdata/testsong_missing_artist.txt");
+ }
+
+ void testSongloadingTxtMissingHeaderFieldTitle()
+ {
+ // disable logging to avoid logmsgs when the exeption
+ // is thrown
+ using namespace log4cxx;
+ Logger::getRootLogger()->setLevel(Level::getOff());
+
+ Songloader::get_instance()->
+ load_header("testdata/testsong_missing_title.txt");
+ }
+
+ void testSongloadingTxtMissingHeaderFieldMp3()
+ {
+ // disable logging to avoid logmsgs when the exeption
+ // is thrown
+ using namespace log4cxx;
+ Logger::getRootLogger()->setLevel(Level::getOff());
+
+ Songloader::get_instance()->
+ load_header("testdata/testsong_missing_mp3.txt");
+
+ }
+
+ void testSongloadingTxtMissingHeaderFieldBpm()
+ {
+ // disable logging to avoid logmsgs when the exeption
+ // is thrown
+ using namespace log4cxx;
+ Logger::getRootLogger()->setLevel(Level::getOff());
+
+ Songloader::get_instance()->
+ load_header("testdata/testsong_missing_bpm.txt");
+ }
+
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(SongloadingTest);