tests/core: Update tags/track test to the new framework
This commit is contained in:
parent
cefadba363
commit
9882727c81
|
@ -22,9 +22,9 @@ res += [ CoreTest("filter", "filter.cpp") ]
|
||||||
res += [ CoreTest("idle", "idle.cpp") ]
|
res += [ CoreTest("idle", "idle.cpp") ]
|
||||||
|
|
||||||
res += SConscript("tags/Sconscript")
|
res += SConscript("tags/Sconscript")
|
||||||
|
|
||||||
Return("res")
|
Return("res")
|
||||||
|
|
||||||
#test( "tags/track" )
|
|
||||||
#
|
#
|
||||||
#test( "random" )
|
#test( "random" )
|
||||||
#
|
#
|
||||||
|
|
|
@ -16,4 +16,5 @@ res += [ TagTest("artist", "artist.cpp") ]
|
||||||
res += [ TagTest("album", "album.cpp") ]
|
res += [ TagTest("album", "album.cpp") ]
|
||||||
res += [ TagTest("genre", "genre.cpp") ]
|
res += [ TagTest("genre", "genre.cpp") ]
|
||||||
res += [ TagTest("library", "library.cpp") ]
|
res += [ TagTest("library", "library.cpp") ]
|
||||||
|
res += [ TagTest("track", "track.cpp") ]
|
||||||
Return("res")
|
Return("res")
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
#include <core/filter.h>
|
#include <core/filter.h>
|
||||||
#include <core/tags/track.h>
|
#include <core/tags/track.h>
|
||||||
#include <tests/test.h>
|
#include "../test.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -58,6 +58,12 @@ static void verify_track_tag(Track *track, unsigned int size)
|
||||||
static void test_track_tag_constructor()
|
static void test_track_tag_constructor()
|
||||||
{
|
{
|
||||||
File f("track_tag", 0);
|
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,
|
Track a(album, artist, genre, library,
|
||||||
"Hyrule Symphony/13 - Legend of Zelda Medley.mp3",
|
"Hyrule Symphony/13 - Legend of Zelda Medley.mp3",
|
||||||
"Legend of Zelda Medley", 288, 13);
|
"Legend of Zelda Medley", 288, 13);
|
||||||
|
@ -207,18 +213,10 @@ static void test_track_tag_locale()
|
||||||
test_equal(b->compare_date(a), -2015);
|
test_equal(b->compare_date(a), -2015);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
DECLARE_UNIT_TESTS(
|
||||||
{
|
UNIT_TEST("Track Tag Default Constructor", test_track_tag_default),
|
||||||
test :: reset_data_dir();
|
UNIT_TEST("Track Tag Constructor", test_track_tag_constructor),
|
||||||
album = tags :: get_album("Hyrule Symphony", 1998);
|
UNIT_TEST("Track Tag Destructor Test", test_track_tag_destructor),
|
||||||
artist = tags :: get_artist("Koji Kondo");
|
UNIT_TEST("Track Tag Lookup Test", test_track_tag_lookup),
|
||||||
genre = tags :: get_genre("Video Game Music");
|
UNIT_TEST("Track Tag Locale Test", test_track_tag_locale),
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue