From 864a45ee13e462574d8c15e09711a0aec7a296f8 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 5 Aug 2008 05:44:02 +0000 Subject: [PATCH] tests/check/gst/gstpreset.c: Only run preset tests when $HOME is writable. Preliminary fix for #545433. Original commit message from CVS: * tests/check/gst/gstpreset.c: Only run preset tests when $HOME is writable. Preliminary fix for #545433. --- ChangeLog | 6 ++++++ tests/check/gst/gstpreset.c | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51f80e640b..73b95afdc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-05 Stefan Kost + + * tests/check/gst/gstpreset.c: + Only run preset tests when $HOME is writable. Preliminary fix for + #545433. + 2008-08-04 Wim Taymans * gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func), diff --git a/tests/check/gst/gstpreset.c b/tests/check/gst/gstpreset.c index 120aeffc0b..e0ab204676 100644 --- a/tests/check/gst/gstpreset.c +++ b/tests/check/gst/gstpreset.c @@ -28,6 +28,8 @@ #include #include +#include + static GType gst_preset_test_get_type (void); #define GST_TYPE_PRESET_TEST (gst_preset_test_get_type ()) @@ -278,13 +280,23 @@ gst_preset_suite (void) { Suite *s = suite_create ("GstPreset"); TCase *tc = tcase_create ("preset"); + gchar *gst_dir; + gboolean can_write = FALSE; + + /* cehck if we can create presets */ + gst_dir = g_build_filename (g_get_home_dir (), + ".gstreamer-" GST_MAJORMINOR, NULL); + can_write = (g_access (gst_dir, R_OK | W_OK | X_OK) == 0); + g_free (gst_dir); suite_add_tcase (s, tc); tcase_add_test (tc, test_check); tcase_add_test (tc, test_load); - tcase_add_test (tc, test_add); - tcase_add_test (tc, test_del); - tcase_add_test (tc, test_two_instances); + if (can_write) { + tcase_add_test (tc, test_add); + tcase_add_test (tc, test_del); + tcase_add_test (tc, test_two_instances); + } tcase_add_unchecked_fixture (tc, test_setup, test_teardown); return s;