diff options
author | Robin Nehls <nehls@mi.fu-berlin.de> | 2010-01-15 18:47:28 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:44 +0100 |
commit | 0e54302f812cd92955e78dec74471bf174c809ec (patch) | |
tree | c00e9ff85e938f0b186f652cd252c319cef40f94 | |
parent | c859b5d69488798a56978e9b43c218fe4a7353fc (diff) | |
download | usdx-0e54302f812cd92955e78dec74471bf174c809ec.tar.gz usdx-0e54302f812cd92955e78dec74471bf174c809ec.tar.xz usdx-0e54302f812cd92955e78dec74471bf174c809ec.zip |
Added generic testsong and added more header filds to the unittest
-rw-r--r-- | test/base/songloading.cpp | 29 | ||||
-rw-r--r-- | test/testdata/.testsong_correct.txt.swp | bin | 0 -> 12288 bytes | |||
-rwxr-xr-x | test/testdata/testsong_correct.txt | 27 |
3 files changed, 50 insertions, 6 deletions
diff --git a/test/base/songloading.cpp b/test/base/songloading.cpp index 823bfced..3119d0c4 100644 --- a/test/base/songloading.cpp +++ b/test/base/songloading.cpp @@ -33,7 +33,7 @@ namespace usdx { class SongloadingTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(SongloadingTest); - CPPUNIT_TEST(testSongloadingTxt); + CPPUNIT_TEST(testSongloadingTxtHeader); CPPUNIT_TEST_SUITE_END(); public: @@ -45,13 +45,30 @@ namespace usdx { } - void testSongloadingTxt() + void testSongloadingTxtHeader() { - Song *song = Songloader::get_instance()->load_header( - "../game/songs/Dead Smiling Pirates - I 18 [DEMO]/Dead Smiling Pirates - I 18.txt"); + Song *song = Songloader::get_instance()->load_header("testdata/testsong_correct.txt"); - CPPUNIT_ASSERT( "Dead Smiling Pirates" == song->get_artist() ); - CPPUNIT_ASSERT( "I 18" == song->get_title() ); + CPPUNIT_ASSERT( "Test Ärtist" == song->get_artist() ); + CPPUNIT_ASSERT( "Test Title" == song->get_title() ); + CPPUNIT_ASSERT( "Test.mp3" == song->get_mp3() ); + // TODO bpm array + //CPPUNIT_ASSERT( 42.23 == song->get_bpm() ); + //CPPUNIT_ASSERT( 10 == song->get_gap() ); + CPPUNIT_ASSERT( "Test[BG].jpg" == song->get_background() ); + CPPUNIT_ASSERT( "Test[CO].jpg" == song->get_cover() ); + CPPUNIT_ASSERT( "Test Genre" == song->get_genre() ); + //CPPUNIT_ASSERT( false == song->get_relative() ); + CPPUNIT_ASSERT( "Cpp" == song->get_language() ); + CPPUNIT_ASSERT( "Test[VD#12,3].mkv" == song->get_video() ); + //CPPUNIT_ASSERT( 12.3 == song->get_videogap() ); + //CPPUNIT_ASSERT( 0 == song->get_start() ); + CPPUNIT_ASSERT( "Test0r" == song->get_creator() ); + //CPPUNIT_ASSERT( 7 == song->get_year() ); + //CPPUNIT_ASSERT( 666 == song->get_end() ); + //CPPUNIT_ASSERT( 0 == song->get_notesgap() ); + // TODO encodeing class + //CPPUNIT_ASSERT( UTF-8 == song->get_encodeing() ); } }; diff --git a/test/testdata/.testsong_correct.txt.swp b/test/testdata/.testsong_correct.txt.swp Binary files differnew file mode 100644 index 00000000..69be88a7 --- /dev/null +++ b/test/testdata/.testsong_correct.txt.swp diff --git a/test/testdata/testsong_correct.txt b/test/testdata/testsong_correct.txt new file mode 100755 index 00000000..a50183f7 --- /dev/null +++ b/test/testdata/testsong_correct.txt @@ -0,0 +1,27 @@ +#TITLE:Test Title
+#ARTIST:Test Ärtist
+#MP3:Test.mp3
+#BPM:42.23
+#GAP:10
+#BACKGROUND:Test[BG].jpg
+#COVER:Test[CO].jpg
+#GENRE:Test Genre
+#RELATIVE:no
+#EDITION:Test Edition
+#LANGUAGE:Cpp
+#VIDEO:Test[VD#12,3].mkv
+#VIDEOGAP:0
+#START:0
+#CREATOR:Test0r
+#YEAR:7
+#END:666
+#NOTESGAP:0
+#ENCODEING:UTF-8
+: 1 1 10 Test
+: 2 2 11 söng
+: 4 3 12 in
+- 11
+: 14 4 13 Pro
+: 18 5 14 gress
+: 23 6 15 ! ! 1 !
+E
|