gui/view: Unit test cleanups

- Define __queue_filter_how_changed() for tests that need queue
  callback functions
- Increase column sizes in the view test to make test more reliable

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-08-29 07:59:11 -04:00
parent 1d02024505
commit 15807434a4
2 changed files with 3 additions and 2 deletions

View File

@ -33,6 +33,7 @@ void __playlist_selection_changed() {}
#ifdef TEST_NEED_QUEUE #ifdef TEST_NEED_QUEUE
void __queue_disabled() {} void __queue_disabled() {}
void __queue_filter() {} void __queue_filter() {}
void __queue_filter_how_changed() {}
void __queue_random() {} void __queue_random() {}
void __queue_repeat() {} void __queue_repeat() {}
#endif /* TEST_NEED_QUEUE */ #endif /* TEST_NEED_QUEUE */

View File

@ -90,7 +90,7 @@ static void test_treeview()
if (i == Q_MODEL_FILE_PATH || i == Q_MODEL_FONT) if (i == Q_MODEL_FILE_PATH || i == Q_MODEL_FONT)
continue; continue;
col = gtk_tree_view_get_column(treeview, i); col = gtk_tree_view_get_column(treeview, i);
gtk_tree_view_column_set_fixed_width(col, (i + 1) * 10); gtk_tree_view_column_set_fixed_width(col, (i + 2) * 10);
} }
g_main_loop_run(main_loop); g_main_loop_run(main_loop);
@ -100,7 +100,7 @@ static void test_treeview()
/* The "Played" column gets any remaining space. */ /* The "Played" column gets any remaining space. */
if (has && i != Q_MODEL_LAST_PLAY) if (has && i != Q_MODEL_LAST_PLAY)
test_loop_equal(gui_settings_get(QUEUE_SETTINGS[i]), test_loop_equal(gui_settings_get(QUEUE_SETTINGS[i]),
(i + 1) * 10, i); (i + 2) * 10, i);
} test_loop_passed(); } test_loop_passed();
test_equal(gui_settings_has("gui.queue.filepath"), (bool)false); test_equal(gui_settings_has("gui.queue.filepath"), (bool)false);
test_equal(gui_settings_get("gui.queue.filepath"), 0); test_equal(gui_settings_get("gui.queue.filepath"), 0);