From 490c21a72ed10594781a726e22638921e49f8b31 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 16 Aug 2024 08:58:47 +1000 Subject: [PATCH] tests/webrtcbin: Use fail_unless_matches_string() Use pattern matching against expected error strings that might include internal element names, where the names are default assigned with incrementing integers. When running with CK_FORK=no, there may have been previous tests that ran in the same process and incremented the counters more than when running in the default fork-per-test mode. Part-of: --- .../gst-plugins-bad/tests/check/elements/webrtcbin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c index 19363ac794..db66e57cc5 100644 --- a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c +++ b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c @@ -4343,8 +4343,8 @@ GST_START_TEST (test_reject_create_offer) gst_structure_get (s, "error", G_TYPE_ERROR, &error, NULL); fail_unless (g_error_matches (error, GST_WEBRTC_ERROR, GST_WEBRTC_ERROR_INTERNAL_FAILURE)); - fail_unless_equals_string (error->message, - "Tranceiver with mid (null) has locked mline 1 but the offer only has 0 sections"); + fail_unless_matches_string (error->message, + "Tranceiver with mid \\(null\\) has locked mline 1 but the offer only has 0 sections"); g_clear_error (&error); gst_promise_unref (promise); @@ -4446,9 +4446,9 @@ GST_START_TEST (test_reject_set_description) gst_structure_get (s, "error", G_TYPE_ERROR, &error, NULL); fail_unless (g_error_matches (error, GST_WEBRTC_ERROR, GST_WEBRTC_ERROR_INTERNAL_FAILURE)); - fail_unless_equals_string + fail_unless_matches_string (error->message, - "m-line 0 with transceiver was locked to video, but SDP has audio media"); + "m-line 0 with transceiver was locked to video, but SDP has audio media"); g_clear_error (&error); fail_unless (s != NULL);