summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2012-12-06 14:02:55 +0100
committerMurray Cumming <murrayc@murrayc.com>2012-12-06 14:03:12 +0100
commitbc740de8db39201df5bb17f26dbb7693c26ee5ed (patch)
tree2f857b987b900c72458f65886a03ae2c165edbd4 /tests
parenta1b2c8a5c6adaa59960f563c6eddd5afac8778a2 (diff)
downloadrygel-bc740de8db39201df5bb17f26dbb7693c26ee5ed.tar.gz
tests: Avoid unused method warnings.
Diffstat (limited to 'tests')
-rw-r--r--tests/rygel-http-byte-seek-test.vala7
-rw-r--r--tests/rygel-http-time-seek-test.vala7
-rw-r--r--tests/rygel-searchable-container-test.vala40
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 b1e8ec95..555fd872 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 4ebaf3d1..d79bf37f 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 4bd178f8..99ba4cba 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,