aead4939c3
It is unused now that I have a token matching system in place. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
54 lines
1.4 KiB
C
54 lines
1.4 KiB
C
/*
|
|
* Copyright 2016 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/idle.h>
|
|
#include <core/playlists/artist.h>
|
|
#include <core/tags/artist.h>
|
|
#include <core/tags/library.h>
|
|
#include <core/tags/tags.h>
|
|
#include <tests/test.h>
|
|
|
|
|
|
void test_artist()
|
|
{
|
|
struct playlist *playlist;
|
|
struct library *library;
|
|
struct artist *artist;
|
|
|
|
idle_init_sync();
|
|
tags_init();
|
|
while (idle_run_task()) {};
|
|
|
|
test_equal(pl_artist.pl_new("Koji Kondo"), (bool)false);
|
|
test_equal((void *)pl_artist.pl_get_queue("Koji Kondo"), NULL);
|
|
|
|
/* Add tracks to the collection. */
|
|
library = library_find("tests/Music");
|
|
track_add(library, "tests/Music/Hyrule Symphony/01 - Title Theme.ogg");
|
|
track_add(library, "tests/Music/Hyrule Symphony/02 - Kokiri Forest.ogg");
|
|
|
|
artist = artist_find("Koji Kondo");
|
|
test_equal(artist->ar_playlist, NULL);
|
|
test_equal(pl_artist.pl_delete("Koji Kondo"), (bool)false);
|
|
test_equal(pl_artist.pl_add_track("Koji Kondo", track_get(0)), (bool)false);
|
|
|
|
pl_artist_init(NULL);
|
|
while (idle_run_task()) {};
|
|
playlist = (struct playlist *)artist->ar_playlist;
|
|
|
|
test_equal(queue_size(pl_artist.pl_get_queue("Koji Kondo")), 2);
|
|
test_not_equal(artist->ar_playlist, NULL);
|
|
test_equal(queue_size(&playlist->pl_queue), 2);
|
|
test_equal(pl_artist.pl_remove_track("Koji Kondo", track_get(0)), (bool)false);
|
|
|
|
pl_artist_deinit();
|
|
test_equal(artist->ar_playlist, NULL);
|
|
|
|
tags_deinit();
|
|
idle_deinit();
|
|
}
|
|
|
|
DECLARE_UNIT_TESTS(
|
|
UNIT_TEST("Artist Playlists", test_artist),
|
|
);
|