diff --git a/lib/colmgr.cpp b/lib/colmgr.cpp index fc5f0d63..5eb92377 100644 --- a/lib/colmgr.cpp +++ b/lib/colmgr.cpp @@ -49,7 +49,7 @@ static void list_path(Library *lib) row[c_cols.c_path] = lib->root_path; } -static void library_remove_banned() +static void remove_banned_tracks() { std::set::iterator it; IndexEntry *ent = playlist :: get_tracks("Banned"); @@ -118,5 +118,5 @@ void colmgr :: toggle_path_enabled(const Gtk::TreePath &path) library :: set_enabled(lib, row[c_cols.c_enabled]); if (row[c_cols.c_enabled]) - library_remove_banned(); + remove_banned_tracks(); } diff --git a/tests/lib/colmgr.cpp b/tests/lib/colmgr.cpp index 041d9656..c206486b 100644 --- a/tests/lib/colmgr.cpp +++ b/tests/lib/colmgr.cpp @@ -2,6 +2,7 @@ * Copyright 2014 (c) Anna Schumaker. */ #include +#include #include #include #include @@ -29,6 +30,10 @@ void test_colmgr() while (idle :: run_task()) colmgr :: update_paths(); + + /* + * Test using the newly added library path + */ row = *list->children().end(); row--; @@ -48,6 +53,25 @@ void test_colmgr() colmgr :: del_path(path); test_equal((size_t)list->children().size(), (size_t)1); + + + /* + * Test using the original path + */ + row = *list->children().begin(); + path = Gtk::TreePath(row); + library = tagdb :: lookup_library(0); + + test_equal(library->enabled, true); + test_equal(library :: get_queue()->size(), (unsigned)20); + + colmgr :: toggle_path_enabled(path); + test_equal(library->enabled, false); + test_equal(library :: get_queue()->size(), (unsigned)0); + + colmgr :: toggle_path_enabled(path); + test_equal(library->enabled, true); + test_equal(library :: get_queue()->size(), (unsigned)20); } int main(int argc, char **argv)