From 3a86af43fa208786b5c848c09f9c8e1d3f060931 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 11 Mar 2013 17:32:28 -0600 Subject: [PATCH] filechooserbutton: Add tests for unselect_all() These all pass except one. --- gtk/tests/filechooser.c | 93 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/gtk/tests/filechooser.c b/gtk/tests/filechooser.c index 1fdce206cb..eb38213058 100644 --- a/gtk/tests/filechooser.c +++ b/gtk/tests/filechooser.c @@ -1388,6 +1388,99 @@ static FileChooserButtonTest button_tests[] = FOLDER_NAME_2 /* final_filename */ }, + /* Unselection tests */ + { + "unselect-all-1", + GTK_FILE_CHOOSER_ACTION_OPEN, + NULL, /* initial_current_folder */ + NULL, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + NULL, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + { + "unselect-all-2", + GTK_FILE_CHOOSER_ACTION_OPEN, + NULL, /* initial_current_folder */ + FILE_NAME, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + NULL, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + { + "unselect-all-3", + GTK_FILE_CHOOSER_ACTION_OPEN, + NULL, /* initial_current_folder */ + FILE_NAME, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + FILE_NAME_2, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + { + "unselect-all-4", + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + NULL, /* initial_current_folder */ + NULL, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + NULL, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + { + "unselect-all-4", + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + FOLDER_NAME, /* initial_current_folder */ + NULL, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + NULL, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + { + "unselect-all-5", + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + NULL, /* initial_current_folder */ + FOLDER_NAME, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + NULL, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + { + "unselect-all-6", + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + NULL, /* initial_current_folder */ + FOLDER_NAME, /* initial_filename */ + FALSE, /* open_dialog */ + NULL, /* tweak_current_folder */ + FOLDER_NAME_2, /* tweak_filename */ + 0, /* dialog_response */ + TRUE, /* unselect_all */ + NULL, /* final_current_folder */ + NULL /* final_filename */ + }, + }; static void