[rygel] tests: Avoid unused method warnings.



commit bc740de8db39201df5bb17f26dbb7693c26ee5ed
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Dec 6 14:02:55 2012 +0100

    tests: Avoid unused method warnings.

 tests/rygel-http-byte-seek-test.vala       |    7 +++++
 tests/rygel-http-time-seek-test.vala       |    7 +++++
 tests/rygel-searchable-container-test.vala |   40 +++++++++++++++++++++------
 3 files changed, 45 insertions(+), 9 deletions(-)
---
diff --git a/tests/rygel-http-byte-seek-test.vala b/tests/rygel-http-byte-seek-test.vala
index b1e8ec9..555fd87 100644
--- a/tests/rygel-http-byte-seek-test.vala
+++ b/tests/rygel-http-byte-seek-test.vala
@@ -240,5 +240,12 @@ private class Rygel.HTTPByteSeekTest : GLib.Object {
 
         assert (request.msg.response_headers.get_content_length () ==
                 seek.length);
+
+        /* TODO: This is just here to avoid a warning about
+         * requested() not being used.
+         * How should this really be tested?
+         * Sometimes the result here is true, and sometimes it is false.
+         */
+        /* bool result = */ HTTPByteSeek.requested(request);
     }
 }
diff --git a/tests/rygel-http-time-seek-test.vala b/tests/rygel-http-time-seek-test.vala
index 4ebaf3d..d79bf37 100644
--- a/tests/rygel-http-time-seek-test.vala
+++ b/tests/rygel-http-time-seek-test.vala
@@ -283,5 +283,12 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object {
                                         ("TimeSeekRange.dlna.org");
         assert (header != null);
         assert (this.range_regex.match (header));
+
+        /* TODO: This is just here to avoid a warning about
+         * requested() not being used.
+         * How should this really be tested?
+         * Sometimes the result here is true, and sometimes it is false.
+         */
+        /* bool result = */ HTTPTimeSeek.requested(request);
     }
 }
diff --git a/tests/rygel-searchable-container-test.vala b/tests/rygel-searchable-container-test.vala
index 4bd178f..99ba4cb 100644
--- a/tests/rygel-searchable-container-test.vala
+++ b/tests/rygel-searchable-container-test.vala
@@ -103,23 +103,45 @@ public class TestContainer : MediaContainer, Rygel.SearchableContainer {
         uint total_matches;
 
         // check corners
-        var result = yield search (null, 0, 4, out total_matches, "", null);
-        assert (total_matches == 0);
-        assert (result.size == 4);
+        try {
+            var result = yield search (null, 0, 4, out total_matches, "", null);
+            assert (total_matches == 0);
+            assert (result.size == 4);
+        } catch (GLib.Error error) {
+            assert_not_reached ();
+        }
 
-        result = yield search (null, 10, 4, out total_matches, "", null);
-        assert (total_matches == 0);
-        assert (result.size == 0);
+        try
+        {
+            var result = yield search (null, 10, 4, out total_matches, "", null);
+            assert (total_matches == 0);
+            assert (result.size == 0);
+        } catch (GLib.Error error) {
+            assert_not_reached ();
+        }
 
         for (int i = 1; i < 10; ++i) {
-            result = yield search (null, i, 3, out total_matches, "", null);
-            assert (total_matches == 0);
-            assert (result.size == int.min (10 - i, 3));
+            try {
+                var result = yield search (null, i, 3, out total_matches, "", null);
+                assert (total_matches == 0);
+                assert (result.size == int.min (10 - i, 3));
+            } catch (GLib.Error error) {
+                assert_not_reached ();
+            }
         }
 
         this.loop.quit ();
     }
 
+    /* TODO: This is just here to avoid a warning about
+     * serialize_search_parameters() not being used.
+     * How should this really be tested?
+     */
+    public void test_serialization() {
+         var writer = new GUPnP.DIDLLiteWriter(null);
+         var didl_container = writer.add_container();
+         serialize_search_parameters(didl_container);
+    }
 
     public async MediaObjects? search (SearchExpression? expression,
                                        uint              offset,



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