Commit 1b7c5c4d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

tests: add test for extended message types and gst_bus_timed_pop_filtered

parent 5c47cf75
......@@ -390,6 +390,31 @@ GST_START_TEST (test_timed_pop)
GST_END_TEST;
static GType foo_device_get_type (void);
typedef struct
{
GstDevice device;
} FooDevice;
typedef struct
{
GstDeviceClass device_klass;
} FooDeviceClass;
G_DEFINE_TYPE (FooDevice, foo_device, GST_TYPE_DEVICE);
static void
foo_device_class_init (FooDeviceClass * klass)
{
/* nothing to do here */
}
static void
foo_device_init (FooDevice * device)
{
/* nothing to do here */
}
/* test that you get the messages with pop_filtered */
GST_START_TEST (test_timed_pop_filtered)
{
......@@ -433,6 +458,23 @@ GST_START_TEST (test_timed_pop_filtered)
msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_ERROR);
fail_unless (msg == NULL);
send_5app_1el_1err_2app_messages (0);
{
GstDevice *device;
device = g_object_new (foo_device_get_type (), NULL);
msg = gst_message_new_device_added (NULL, device);
gst_object_unref (device);
GST_LOG ("posting device message");
gst_bus_post (test_bus, msg);
}
send_5app_1el_1err_2app_messages (0);
msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_EXTENDED);
fail_unless (msg != NULL);
fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_DEVICE_ADDED);
gst_message_unref (msg);
gst_object_unref (test_bus);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment