[farsight2/master] Add tests for NULL parameters for FsElementAddedErrors

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:17 PST 2008


---
 tests/check/utils/binadded.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/tests/check/utils/binadded.c b/tests/check/utils/binadded.c
index 5d1891f..823293b 100644
--- a/tests/check/utils/binadded.c
+++ b/tests/check/utils/binadded.c
@@ -244,6 +244,29 @@ GST_START_TEST (test_bin_keyfile)
 }
 GST_END_TEST;
 
+
+GST_START_TEST (test_bin_errors)
+{
+  FsElementAddedNotifier *notifier = NULL;
+
+  g_log_set_always_fatal (0);
+  g_log_set_fatal_mask (NULL, 0);
+
+  ASSERT_CRITICAL (fs_element_added_notifier_add (NULL, NULL));
+  ASSERT_CRITICAL (fs_element_added_notifier_remove (NULL, NULL));
+  ASSERT_CRITICAL (fs_element_added_notifier_set_properties_from_keyfile (NULL, NULL));
+
+  notifier = fs_element_added_notifier_new ();
+
+  ASSERT_CRITICAL (fs_element_added_notifier_add (notifier, NULL));
+  ASSERT_CRITICAL (fs_element_added_notifier_remove (notifier, NULL));
+  ASSERT_CRITICAL (fs_element_added_notifier_set_properties_from_keyfile (notifier, NULL));
+
+  g_object_unref (notifier);
+}
+GST_END_TEST;
+
+
 static Suite *
 binadded_suite (void)
 {
@@ -254,6 +277,7 @@ binadded_suite (void)
   tcase_add_test (tc_chain, test_bin_added_simple);
   tcase_add_test (tc_chain, test_bin_added_recursive);
   tcase_add_test (tc_chain, test_bin_keyfile);
+  tcase_add_test (tc_chain, test_bin_errors);
 
   return s;
 }
-- 
1.5.6.5




More information about the farsight-commits mailing list