[gupnp-av] Add test for issue in bgo#753314



commit ec73bdc44b9bbb14c61cd297423aee69a31e6a30
Author: Jens Georg <mail jensge org>
Date:   Sat Aug 8 14:17:48 2015 +0200

    Add test for issue in bgo#753314
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753382

 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 ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]