tests/core: Update tags/track test to the new framework

This commit is contained in:
Anna Schumaker 2015-08-27 13:17:08 -04:00
parent cefadba363
commit 9882727c81
3 changed files with 16 additions and 17 deletions

View File

@ -22,9 +22,9 @@ res += [ CoreTest("filter", "filter.cpp") ]
res += [ CoreTest("idle", "idle.cpp") ]
res += SConscript("tags/Sconscript")
Return("res")
#test( "tags/track" )
#
#test( "random" )
#

View File

@ -16,4 +16,5 @@ res += [ TagTest("artist", "artist.cpp") ]
res += [ TagTest("album", "album.cpp") ]
res += [ TagTest("genre", "genre.cpp") ]
res += [ TagTest("library", "library.cpp") ]
res += [ TagTest("track", "track.cpp") ]
Return("res")

View File

@ -3,7 +3,7 @@
*/
#include <core/filter.h>
#include <core/tags/track.h>
#include <tests/test.h>
#include "../test.h"
#include <set>
#include <sstream>
@ -58,6 +58,12 @@ static void verify_track_tag(Track *track, unsigned int size)
static void test_track_tag_constructor()
{
File f("track_tag", 0);
album = tags :: get_album("Hyrule Symphony", 1998);
artist = tags :: get_artist("Koji Kondo");
genre = tags :: get_genre("Video Game Music");
library = tags :: get_library(MUSIC_DIR);
Track a(album, artist, genre, library,
"Hyrule Symphony/13 - Legend of Zelda Medley.mp3",
"Legend of Zelda Medley", 288, 13);
@ -207,18 +213,10 @@ static void test_track_tag_locale()
test_equal(b->compare_date(a), -2015);
}
int main(int argc, char **argv)
{
test :: reset_data_dir();
album = tags :: get_album("Hyrule Symphony", 1998);
artist = tags :: get_artist("Koji Kondo");
genre = tags :: get_genre("Video Game Music");
library = tags :: get_library(MUSIC_DIR);
test :: run("Track Tag Default Constructor Test", test_track_tag_default);
test :: run("Track Tag Constructor Test", test_track_tag_constructor);
test :: run("Track Tag Destructor Test", test_track_tag_destructor);
test :: run("Track Tag Lookup Test", test_track_tag_lookup);
test :: run("Track Tag Locale Test", test_track_tag_locale);
return 0;
}
DECLARE_UNIT_TESTS(
UNIT_TEST("Track Tag Default Constructor", test_track_tag_default),
UNIT_TEST("Track Tag Constructor", test_track_tag_constructor),
UNIT_TEST("Track Tag Destructor Test", test_track_tag_destructor),
UNIT_TEST("Track Tag Lookup Test", test_track_tag_lookup),
UNIT_TEST("Track Tag Locale Test", test_track_tag_locale),
);