webrtcstats: Update unit test for outbound rtp stats

"remote-id" is not guaranteed to present after commit 1deb034e3d.
Thus, we should not fail the test if "remote-id" is not found.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
This commit is contained in:
Sherrill Lin 2021-09-01 16:12:24 +00:00 committed by GStreamer Marge Bot
parent 3e7fb83393
commit f335b40ae8

View file

@ -1528,14 +1528,14 @@ validate_outbound_rtp_stats (const GstStructure * s, const GstStructure * stats)
&packets_sent, NULL)); &packets_sent, NULL));
fail_unless (gst_structure_get (s, "bytes-sent", G_TYPE_UINT64, &bytes_sent, fail_unless (gst_structure_get (s, "bytes-sent", G_TYPE_UINT64, &bytes_sent,
NULL)); NULL));
fail_unless (gst_structure_get (s, "remote-id", G_TYPE_STRING, &remote_id, if (gst_structure_get (s, "remote-id", G_TYPE_STRING, &remote_id, NULL)) {
NULL)); fail_unless (gst_structure_get (stats, remote_id, GST_TYPE_STRUCTURE,
fail_unless (gst_structure_get (stats, remote_id, GST_TYPE_STRUCTURE, &remote, &remote, NULL));
NULL)); fail_unless (remote != NULL);
fail_unless (remote != NULL);
gst_structure_free (remote); gst_structure_free (remote);
g_free (remote_id); g_free (remote_id);
}
} }
static void static void
@ -1703,7 +1703,7 @@ GST_START_TEST (test_stats_with_stream)
gst_caps_unref (caps); gst_caps_unref (caps);
test_webrtc_wait_for_answer_error_eos (t); test_webrtc_wait_for_answer_error_eos (t);
fail_unless (t->state == STATE_ANSWER_SET); test_webrtc_signal_state (t, STATE_ANSWER_SET);
p = gst_promise_new_with_change_func (_on_stats, t, NULL); p = gst_promise_new_with_change_func (_on_stats, t, NULL);
g_signal_emit_by_name (t->webrtc1, "get-stats", NULL, p); g_signal_emit_by_name (t->webrtc1, "get-stats", NULL, p);