tests/core: Update library test to the new framework

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-08-31 08:11:24 -04:00
parent ff26171d6f
commit b81b1eeda7
2 changed files with 15 additions and 18 deletions

View File

@ -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" )

View File

@ -4,7 +4,7 @@
#include <core/idle.h>
#include <core/library.h>
#include <core/tags/tags.h>
#include <tests/test.h>
#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),
);