diff --git a/lib/deck.cpp b/lib/deck.cpp index dbc7f7d1..8b2856f9 100644 --- a/lib/deck.cpp +++ b/lib/deck.cpp @@ -157,8 +157,11 @@ Playqueue *deck :: get_library_pq() } #ifdef CONFIG_TEST +static void no_op() {} + void deck :: reset() { + get_callbacks()->on_queue_changed = no_op; playqueue_deck.clear(); library_playqueue.reset(); } diff --git a/tests/deck/deck.cpp b/tests/deck/deck.cpp index 74aad611..27268e33 100644 --- a/tests/deck/deck.cpp +++ b/tests/deck/deck.cpp @@ -98,21 +98,15 @@ void test_5() deck :: get(2)->set_flag(PQ_ENABLED); deck :: get(2)->set_flag(PQ_RANDOM); - File f("playqueue.lst", FILE_TYPE_DATA); - print("Saving playqueue deck\n"); - f.open(OPEN_WRITE); deck :: write(); - f.close(); print("Clearing deck\n"); deck :: reset(); deck :: print_info(); print("Reading back playqueue deck\n"); - f.open(OPEN_READ); - deck :: read(); - f.close(); + deck :: init(); deck :: print_info(); } diff --git a/tests/deck/deck.good b/tests/deck/deck.good index f57d826e..9a346727 100644 --- a/tests/deck/deck.good +++ b/tests/deck/deck.good @@ -110,10 +110,10 @@ Playing id: 6 Playing id: 7 Playing id: 8 Playing id: 9 -Playing id: 0 -Playing id: 1 -Playing id: 2 -Playing id: 3 +Playing id: 149 +Playing id: 148 +Playing id: 147 +Playing id: 146 deck[0] = Playqueue { size = 16, flags = 0 } deck[1] = Playqueue { size = 19, flags = 0 } deck[2] = Playqueue { size = 15, flags = 0 }