diff --git a/tests/core/Sconscript b/tests/core/Sconscript index c15f76cd..c6e28aef 100644 --- a/tests/core/Sconscript +++ b/tests/core/Sconscript @@ -23,14 +23,13 @@ res += [ CoreTest("filter", "filter.cpp") ] res += [ CoreTest("idle", "idle.cpp") ] res += SConscript("tags/Sconscript") - res += [ CoreTest("queue", "queue.cpp") ] +env.UsePackage("taglib") +res += [ CoreTest("library", "library.cpp") ] + Return("res") -# -#test_env.UsePackage("taglib") -#test( "library" ) #test( "playlist" ) #test( "deck" ) #test( "audio" ) diff --git a/tests/core/library.cpp b/tests/core/library.cpp index 6d172dfd..5cfc8e49 100644 --- a/tests/core/library.cpp +++ b/tests/core/library.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include "test.h" static Queue *Q_NULL = NULL; static Library *LIB_NULL = NULL; @@ -17,6 +17,7 @@ static void test_init() test_equal(q->has_flag(Q_ENABLED), true); test_equal(q->has_flag(Q_REPEAT), true); + test_cp_data_dir(); tags :: init(); library :: init(); @@ -66,7 +67,7 @@ static void test_add() { Queue *q = library :: get_queue(); - test :: gen_library(); + test_generate_library(); library :: add("/tmp/ocarina/"); test_equal(q->size(), (unsigned)0); @@ -82,7 +83,7 @@ static void test_add() static void test_update() { Queue *q = library :: get_queue(); - test :: rm_library_dirs(); + test_rm_library_dirs(); library :: update_all(); test_equal(idle :: run_task(), true); @@ -93,7 +94,7 @@ static void test_update() test_equal(q->size(), (unsigned)21); - test :: gen_library(); + test_generate_library(); library :: update_all(); test_equal(idle :: run_task(), true); @@ -104,13 +105,10 @@ static void test_update() test_equal(q->size(), (unsigned)35); } -int main(int argc, char **argv) -{ - test :: cp_data_dir(); - - test :: run("Library Init Test", test_init); - test :: run("Library Enable and Disable Test", test_enable); - test :: run("Library Delete Path Test", test_remove); - test :: run("Library Add Path Test", test_add); - test :: run("Library Update Path Test", test_update); -} +DECLARE_UNIT_TESTS( + UNIT_TEST("Library Init", test_init), + UNIT_TEST("Library Enable and Disable", test_enable), + UNIT_TEST("Library Delete Path", test_remove), + UNIT_TEST("Library Add Path", test_add), + UNIT_TEST("Library Update Path", test_update), +);