diff options
author | Jens Georg <mail@jensge.org> | 2015-08-08 14:17:48 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2015-11-05 15:53:02 +0100 |
commit | ec73bdc44b9bbb14c61cd297423aee69a31e6a30 (patch) | |
tree | 63a4c84c7651b8adbb979a39cbb4771bf48aa3de | |
parent | c7ee091e303f33e299e94d6d27b94b65ce9779c8 (diff) | |
download | gupnp-av-ec73bdc44b9bbb14c61cd297423aee69a31e6a30.tar.gz |
Add test for issue in bgo#753314
Signed-off-by: Jens Georg <mail@jensge.org>
https://bugzilla.gnome.org/show_bug.cgi?id=753382
-rw-r--r-- | tests/gtest/test-regression.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/gtest/test-regression.c b/tests/gtest/test-regression.c index 78c8e1a..6efe333 100644 --- a/tests/gtest/test-regression.c +++ b/tests/gtest/test-regression.c @@ -121,6 +121,44 @@ test_bgo705564 (void) g_object_unref (writer); } +static void +test_bgo753314 (void) +{ + GUPnPDIDLLiteObject *object; + GUPnPDIDLLiteWriter *writer; + GUPnPDIDLLiteResource *resource; + GUPnPProtocolInfo *pi; + GList *list = NULL; + GUPnPDLNAFlags flags = GUPNP_DLNA_FLAGS_NONE; + + flags = GUPNP_DLNA_FLAGS_BYTE_BASED_SEEK | + GUPNP_DLNA_FLAGS_STREAMING_TRANSFER_MODE | + GUPNP_DLNA_FLAGS_BACKGROUND_TRANSFER_MODE; + + writer = gupnp_didl_lite_writer_new (NULL); + object = (GUPnPDIDLLiteObject *) + gupnp_didl_lite_writer_add_item (writer); + resource = gupnp_didl_lite_object_add_resource (object); + pi = gupnp_protocol_info_new (); + gupnp_protocol_info_set_protocol (pi, "http"); + gupnp_protocol_info_set_mime_type (pi, "video/mp4"); + gupnp_protocol_info_set_dlna_flags (pi, flags); + gupnp_didl_lite_resource_set_protocol_info (resource, pi); + g_object_unref (pi); + g_object_unref (resource); + + list = gupnp_didl_lite_object_get_resources (object); + g_assert_cmpint (g_list_length (list), ==, 1); + + resource = list->data; + pi = gupnp_didl_lite_resource_get_protocol_info (resource); + + g_assert_cmpint (gupnp_protocol_info_get_dlna_flags (pi), ==, flags); + g_object_unref (resource); + g_object_unref (object); + g_object_unref (writer); +} + int main (int argc, char *argv[]) { #if !GLIB_CHECK_VERSION (2, 35, 0) @@ -131,6 +169,7 @@ int main (int argc, char *argv[]) g_test_add_func ("/bugs/gnome/674319", test_bgo674319); g_test_add_func ("/bugs/gnome/687462", test_bgo687462); g_test_add_func ("/bugs/gnome/705564", test_bgo705564); + g_test_add_func ("/bugs/gnome/753314", test_bgo753314); g_test_run (); |