mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 05:12:09 +00:00
tests: leaks: Allow null tracer string if there's no available stack trace
In case that no available stack tracer, leak tracer will set null string value for `trace` field. I would likely happen on Windows. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/625>
This commit is contained in:
parent
f120ad0012
commit
7d12aa07d4
1 changed files with 11 additions and 2 deletions
|
@ -224,6 +224,13 @@ GST_START_TEST (test_get_live_objects_filtered_detailed)
|
|||
GstPad *srcpad;
|
||||
GstMessage *m;
|
||||
struct RetBufferCtx *ctx = g_new0 (struct RetBufferCtx, 1);
|
||||
gboolean check_trace = FALSE;
|
||||
|
||||
#if defined (HAVE_BACKTRACE) || defined (HAVE_UNWIND) || defined (HAVE_DBGHELP)
|
||||
/* Otherwise, trace string (returned from gst_debug_get_stack_trace())
|
||||
* will be null */
|
||||
check_trace = TRUE;
|
||||
#endif
|
||||
|
||||
pipe = gst_pipeline_new ("pipeline");
|
||||
fail_unless (pipe);
|
||||
|
@ -286,7 +293,8 @@ GST_START_TEST (test_get_live_objects_filtered_detailed)
|
|||
fail_unless_equals_int (ref_count, 1);
|
||||
|
||||
fail_unless (gst_structure_has_field_typed (s, "trace", G_TYPE_STRING));
|
||||
fail_unless (gst_structure_get_string (s, "trace"));
|
||||
if (check_trace)
|
||||
fail_unless (gst_structure_get_string (s, "trace"));
|
||||
|
||||
fail_unless (gst_structure_has_field_typed (s, "ref-infos",
|
||||
GST_TYPE_LIST));
|
||||
|
@ -312,7 +320,8 @@ GST_START_TEST (test_get_live_objects_filtered_detailed)
|
|||
fail_unless (ref_count > 0);
|
||||
|
||||
fail_unless (gst_structure_has_field_typed (r, "trace", G_TYPE_STRING));
|
||||
fail_unless (gst_structure_get_string (r, "trace"));
|
||||
if (check_trace)
|
||||
fail_unless (gst_structure_get_string (r, "trace"));
|
||||
|
||||
fail_unless_equals_int (gst_structure_n_fields (r), 4);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue