[maemo-commits] [maemo-commits] r15914 - projects/haf/trunk/hildon-fm/tests
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Thu Aug 28 14:58:01 EEST 2008
- Previous message: [maemo-commits] r15913 - projects/haf/tags/hildon-control-panel
- Next message: [maemo-commits] r15915 - projects/haf/trunk/hildon-fm/tests
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: jukkkaup Date: 2008-08-28 14:58:00 +0300 (Thu, 28 Aug 2008) New Revision: 15914 Modified: projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-chooser-dialog.c projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-details-dialog.c projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-settings.c projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-storage-dialog.c Log: * Updated hildon-fm unit tests to their newest versions Modified: projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-chooser-dialog.c =================================================================== --- projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-chooser-dialog.c 2008-08-28 11:42:03 UTC (rev 15913) +++ projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-chooser-dialog.c 2008-08-28 11:58:00 UTC (rev 15914) @@ -149,6 +149,7 @@ //gtk_container_remove (GTK_CONTAINER (fcd_window), fcd); //gtk_widget_hide_all (fcd_window); //printf ("HERE WE ARE !!!\n"); + g_object_unref (fcd); gtk_widget_destroy (fcd_window); gtk_widget_destroy (fcd); } Modified: projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-details-dialog.c =================================================================== --- projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-details-dialog.c 2008-08-28 11:42:03 UTC (rev 15913) +++ projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-details-dialog.c 2008-08-28 11:58:00 UTC (rev 15914) @@ -77,6 +77,11 @@ static void fx_teardown_default_hildonfm_file_details_dialog () { + //g_object_ref_sink(fs); + g_object_unref (fs); + g_object_unref (fdd); + g_object_unref (model); + g_object_unref (fdd_window); gtk_widget_destroy (GTK_WIDGET (fdd_window)); gtk_widget_destroy (GTK_WIDGET (fdd)); } Modified: projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-settings.c =================================================================== --- projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-settings.c 2008-08-28 11:42:03 UTC (rev 15913) +++ projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-settings.c 2008-08-28 11:58:00 UTC (rev 15914) @@ -126,6 +126,20 @@ END_TEST /** + * Purpose: Check if writing user settings with NULL works. + */ +START_TEST (test_file_system_write_user_settings_null) +{ + GKeyFile *key_file; + + hildon_file_system_write_user_settings (NULL); + key_file = hildon_file_system_open_user_settings (); + fail_if (!key_file, + "Opening user settings after writing them with NULL failed"); +} +END_TEST + +/** * Purpose: Check if getting the type of a HildonFileSystemSettings works */ START_TEST (test_file_system_settings_type) @@ -137,6 +151,25 @@ } END_TEST +/** + * Purpose: Check if calling settings_ready works + */ +START_TEST (test_file_system_settings_ready) +{ + gboolean ret; + + ret = _hildon_file_system_settings_ready (fss); + fail_if (ret, "Settings are ready before any gtk_main_iterations"); + + while (!_hildon_file_system_settings_ready (fss)) + { + gtk_main_iteration (); + } + ret = _hildon_file_system_settings_ready (fss); + fail_if (!ret, "Settings readiness is dependent on settings_ready"); +} +END_TEST + /* ------------------ Suite creation ------------------ */ Suite *create_hildonfm_file_system_settings_suite () @@ -152,7 +185,9 @@ fx_teardown_hildonfm_file_system_settings); tcase_add_test (tc1, test_file_system_settings_get_instance); tcase_add_test (tc1, test_file_system_user_settings); + tcase_add_test (tc1, test_file_system_write_user_settings_null); tcase_add_test (tc1, test_file_system_settings_type); + tcase_add_test (tc1, test_file_system_settings_ready); suite_add_tcase (s, tc1); /* Return created suite */ Modified: projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-storage-dialog.c =================================================================== --- projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-storage-dialog.c 2008-08-28 11:42:03 UTC (rev 15913) +++ projects/haf/trunk/hildon-fm/tests/check-hildonfm-file-system-storage-dialog.c 2008-08-28 11:58:00 UTC (rev 15914) @@ -138,7 +138,7 @@ START_TEST (test_file_system_storage_dialog_new_tmp) { fssd = hildon_file_system_storage_dialog_new (fssd_window, "file:///tmp"); - fail_if (!HILDON_IS_FILE_SYSTEM_STORAGE_DIALOG (fssd), + fail_if (!HILDON_IS_FILE_SYSTEM_STORAGE_DIALOG (fssd), "File system storage dialog creation failed"); } END_TEST @@ -148,7 +148,7 @@ */ START_TEST (test_file_system_storage_dialog_new_special_location) { - char *folder = g_strconcat (start, ".documents", NULL); + char *folder = g_strconcat (start, "/.documents", NULL); fssd = hildon_file_system_storage_dialog_new (fssd_window, folder); fail_if (!HILDON_IS_FILE_SYSTEM_STORAGE_DIALOG (fssd), @@ -156,6 +156,20 @@ } END_TEST +/** + * Purpose: Check if creating a new storage dialog works with a non-existent + * location + */ +START_TEST (test_file_system_storage_dialog_new_non_existent) +{ + char *folder = g_strconcat (start, "/fake.file", NULL); + + fssd = hildon_file_system_storage_dialog_new (fssd_window, folder); + fail_if (!HILDON_IS_FILE_SYSTEM_STORAGE_DIALOG (fssd), + "File system storage dialog creation failed"); +} +END_TEST + /* ------------------ Suite creation ------------------ */ Suite *create_hildonfm_file_system_storage_dialog_suite () @@ -180,6 +194,7 @@ tcase_add_test (tc2, test_file_system_storage_dialog_new_null_and_set_uri); tcase_add_test (tc2, test_file_system_storage_dialog_new_tmp); tcase_add_test (tc2, test_file_system_storage_dialog_new_special_location); + tcase_add_test (tc2, test_file_system_storage_dialog_new_non_existent); suite_add_tcase (s, tc2); /* Return created suite */
- Previous message: [maemo-commits] r15913 - projects/haf/tags/hildon-control-panel
- Next message: [maemo-commits] r15915 - projects/haf/trunk/hildon-fm/tests
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]