check: gst_promise_reply() takes ownership

Copy the structure temporarily to check it further down.

CID #1455392

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
This commit is contained in:
Edward Hervey 2020-05-08 07:03:49 +02:00 committed by Edward Hervey
parent 78b0baa7c9
commit b6c9491c92

View file

@ -162,12 +162,13 @@ GST_START_TEST (test_reply_data)
r = gst_promise_new ();
s = gst_structure_new ("promise", "test", G_TYPE_INT, 1, NULL);
gst_promise_reply (r, s);
gst_promise_reply (r, gst_structure_copy (s));
fail_unless (gst_promise_wait (r) == GST_PROMISE_RESULT_REPLIED);
ret = gst_promise_get_reply (r);
fail_unless (gst_structure_is_equal (ret, s));
gst_promise_unref (r);
gst_structure_free (s);
}
GST_END_TEST;