AG_GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
+GST_DISABLE_CAST_CHECKS_DEFINE=0
+AC_SUBST(GST_DISABLE_CAST_CHECKS_DEFINE)
+
+GST_DISABLE_GLIB_ASSERTS_DEFINE=0
+AC_SUBST(GST_DISABLE_GLIB_ASSERTS_DEFINE)
+
+GST_DISABLE_GLIB_CHECKS_DEFINE=0
+AC_SUBST(GST_DISABLE_GLIB_CHECKS_DEFINE)
+
+
AG_GST_ARG_DEBUG
AG_GST_ARG_PROFILING
AG_GST_ARG_VALGRIND
*/
@GST_DISABLE_REGISTRY_DEFINE@
+/**
+ * GST_DISABLE_CAST_CHECKS:
+ *
+ * Disable run-time GObject cast checks
+ */
+#define GST_DISABLE_CAST_CHECKS @GST_DISABLE_CAST_CHECKS_DEFINE@
+
+/**
+ * GST_DISABLE_GLIB_ASSERTS:
+ *
+ * Disable GLib assertion
+ */
+#define GST_DISABLE_GLIB_ASSERTS @GST_DISABLE_GLIB_ASSERTS_DEFINE@
+
+/**
+ * GST_DISABLE_GLIB_CHECKS:
+ *
+ * Disable GLib checks such as API guards
+ */
+#define GST_DISABLE_GLIB_CHECKS @GST_DISABLE_GLIB_CHECKS_DEFINE@
+
+
/* FIXME: test and document these! */
/* Configures the use of external plugins */
@GST_DISABLE_PLUGIN_DEFINE@
gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#define GST_DISABLE_PARSE 1')
endif
+gst_cdata.set10('GST_DISABLE_CAST_CHECKS_DEFINE', cast_checks.disabled())
+gst_cdata.set10('GST_DISABLE_GLIB_ASSERTS_DEFINE', glib_asserts.disabled())
+gst_cdata.set10('GST_DISABLE_GLIB_CHECKS_DEFINE', glib_checks.disabled())
+
# FIXME: add --disable-plugin option?
gst_cdata.set('GST_DISABLE_PLUGIN_DEFINE', '#undef GST_DISABLE_PLUGIN')
#define THREAD_TEST_RUNNING() (!!_gst_check_threads_running)
/* additional assertions */
+
+#if GST_DISABLE_GLIB_CHECKS
+#define ASSERT_CRITICAL(code)
+#else
#define ASSERT_CRITICAL(code) \
G_STMT_START { \
_gst_check_expecting_log = TRUE; \
"Expected g_critical, got nothing", NULL); \
_gst_check_expecting_log = FALSE; \
} G_STMT_END
+#endif /* GST_DISABLE_GLIB_CHECKS */
#define ASSERT_WARNING(code) \
G_STMT_START { \
GST_START_TEST (test_broken)
{
- GstCaps *c1;
+ GstCaps *c1 = NULL;
/* NULL is not valid for media_type */
ASSERT_CRITICAL (c1 =
gst_caps_new_simple (NULL, "field", G_TYPE_INT, 1, NULL));
fail_if (c1);
-#ifndef G_DISABLE_CHECKS
/* such a name is not valid, see gst_structure_validate_name() */
ASSERT_CRITICAL (c1 =
gst_caps_new_simple ("1#@abc", "field", G_TYPE_INT, 1, NULL));
fail_if (c1);
-#endif
}
GST_END_TEST;
fail_unless (unlinked_count2 == 0);
/* this should fail with a critial */
+ dummy = NULL;
ASSERT_CRITICAL (dummy = gst_ghost_pad_new ("ghostpad", srcpad));
fail_unless (dummy == NULL);
fail_unless (linked_count1 == 1);
parent = gst_object_get_parent (object1);
fail_if (parent != NULL, "GstFakeObject has parent");
/* try to set a NULL parent, this should give a warning */
+ result = FALSE;
ASSERT_CRITICAL (result = gst_object_set_parent (object1, NULL));
fail_if (result, "GstFakeObject accepted NULL parent");
/* try to set itself as parent, we expect a warning here */
gst_structure_free (structure);
s = "0.10:decoder-video/mpeg, abc=(boolean)false";
+ structure = NULL;
ASSERT_CRITICAL (structure = gst_structure_from_string (s, NULL));
fail_unless (structure == NULL, "Could not get structure from string %s", s);
GST_START_TEST (test_to_string)
{
- GstStructure *st1;
+ GstStructure *st1 = NULL;
ASSERT_CRITICAL (st1 = gst_structure_new_empty ("Foo\nwith-newline"));
fail_unless (st1 == NULL);
("0.10:decoder-video/mpeg")));
/* make sure we bail out correctly in case of an error or if parsing fails */
+ s = NULL;
ASSERT_CRITICAL (s = gst_structure_new ("^joo\nba\ndoo^",
"abc", G_TYPE_BOOLEAN, FALSE, NULL));
fail_unless (s == NULL);
#ifndef GST_REMOVE_DEPRECATED
GST_START_TEST (test_gst_uri_construct)
{
- gchar *l;
+ gchar *l = NULL;
/* URI with no protocol or empty protocol should return empty string */
ASSERT_CRITICAL (l = gst_uri_construct (NULL, "/path/to/file"));
str =
g_strdup_printf ("foo/bar, range=[ 1, %" G_GINT64_FORMAT " ];",
(gint64) G_MAXINT + 1);
+ s = NULL;
ASSERT_CRITICAL (s = gst_structure_from_string (str, &end));
g_free (str);
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
str =
g_strdup_printf ("foo/bar, range=[ %" G_GINT64_FORMAT ", %"
G_GINT64_FORMAT " ];", (gint64) G_MAXINT, (gint64) G_MAXINT + 1);
ASSERT_CRITICAL (s = gst_structure_from_string (str, NULL));
end = NULL;
g_free (str);
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
/* check a valid int64_range deserialization. Those ranges need to
* be explicit about their storage type. */
str =
g_strdup_printf ("foo/bar, range=(gint64)[ 1, %" G_GUINT64_FORMAT " ];",
(guint64) G_MAXINT64 + 1);
+ s = NULL;
ASSERT_CRITICAL (s = gst_structure_from_string (str, &end));
- fail_unless (*end == '\0');
- gst_structure_free (s);
- end = NULL;
+ if (s) {
+ fail_unless (*end == '\0');
+ gst_structure_free (s);
+ end = NULL;
+ }
g_free (str);
/* check invalid int64_range deserialization into a int64_range */
G_GUINT64_FORMAT " ];", (gint64) G_MAXINT, (guint64) G_MAXINT64 + 1);
ASSERT_CRITICAL (s = gst_structure_from_string (str, NULL));
g_free (str);
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
/* check invalid int64_range deserialization into a int_range */
str =
fail_unless (s != NULL);
fail_unless (*end == '\0');
gst_structure_free (s);
+ s = NULL;
g_free (str);
}
for (n = 0; n < G_N_ELEMENTS (bad_ranges); ++n) {
str = g_strdup_printf ("foo/bar, range=%s", bad_ranges[n]);
ASSERT_CRITICAL (s = gst_structure_from_string (str, &end));
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
g_free (str);
}
}
GstBuffer *buffer;
guint avail;
GstMapInfo info;
- const guint8 *data1, *data2, *idata;
+ const guint8 *data1 = NULL, *data2 = NULL, *idata = NULL;
adapter = gst_adapter_new ();
fail_if (adapter == NULL);