From 9882727c81c5b87299e4dc69f3cbb22b645a2bb9 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 27 Aug 2015 13:17:08 -0400 Subject: [PATCH] tests/core: Update tags/track test to the new framework --- tests/core/Sconscript | 2 +- tests/core/tags/Sconscript | 1 + tests/core/tags/track.cpp | 30 ++++++++++++++---------------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/tests/core/Sconscript b/tests/core/Sconscript index 4ac3e7b1..0a83f2f9 100644 --- a/tests/core/Sconscript +++ b/tests/core/Sconscript @@ -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" ) # diff --git a/tests/core/tags/Sconscript b/tests/core/tags/Sconscript index fa075a24..07476052 100644 --- a/tests/core/tags/Sconscript +++ b/tests/core/tags/Sconscript @@ -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") diff --git a/tests/core/tags/track.cpp b/tests/core/tags/track.cpp index 05b960b7..19b52640 100644 --- a/tests/core/tags/track.cpp +++ b/tests/core/tags/track.cpp @@ -3,7 +3,7 @@ */ #include #include -#include +#include "../test.h" #include #include @@ -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), +);