tests: udpsrc: fix test_udpsrc to actually run and fix locking
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Fri, 25 Aug 2017 11:45:52 +0000 (14:45 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 16:05:28 +0000 (16:05 +0000)
Previously this would silently be skipped because 1600 != 1400
and there is no assertion on this call.

Also unlock check_mutex after use.

https://bugzilla.gnome.org/show_bug.cgi?id=786799

tests/check/elements/udpsrc.c

index d3705eb..ae17c7f 100644 (file)
@@ -165,7 +165,7 @@ GST_START_TEST (test_udpsrc)
   if (g_socket_send_to (socket, sa, data, 1600, NULL, NULL) != 1600)
     goto send_failure;
 
-  if (g_socket_send_to (socket, sa, data, 1600, NULL, NULL) != 1400)
+  if (g_socket_send_to (socket, sa, data, 1400, NULL, NULL) != 1400)
     goto send_failure;
 
   GST_INFO ("sent some packets");
@@ -218,6 +218,8 @@ GST_START_TEST (test_udpsrc)
   g_list_free (buffers);
   buffers = NULL;
 
+  g_mutex_unlock (&check_mutex);
+
 no_socket:
 send_failure: