[rygel] test: Remove some warnings



commit ec94db84ed7f7243082ace37c71da0ce50414aae
Author: Jens Georg <mail jensge org>
Date:   Sat Aug 1 16:18:13 2020 +0200

    test: Remove some warnings

 tests/time-seek/rygel-http-time-seek-test.vala | 30 +++++++++-----------------
 1 file changed, 10 insertions(+), 20 deletions(-)
---
diff --git a/tests/time-seek/rygel-http-time-seek-test.vala b/tests/time-seek/rygel-http-time-seek-test.vala
index c6715711..1b51840a 100644
--- a/tests/time-seek/rygel-http-time-seek-test.vala
+++ b/tests/time-seek/rygel-http-time-seek-test.vala
@@ -28,63 +28,53 @@ void test_time_seek_malformed_header () {
 
     // Test without the header
     try {
-        var request = new Rygel.HTTPTimeSeekRequest (message, handler, null);
+        new Rygel.HTTPTimeSeekRequest (message, handler, null);
         assert_not_reached ();
-    } catch (Rygel.HTTPSeekRequestError e) {
+    } catch (Error e) {
         // Pass - we only expect a HTTPSeekRequestError
         assert (e is Rygel.HTTPSeekRequestError.INVALID_RANGE);
-    } catch (Error e) {
-        assert_not_reached ();
     }
 
     // Test empty header
     message.request_headers.replace (Rygel.HTTPTimeSeekRequest.TIMESEEKRANGE_HEADER, "");
     try {
-        var request = new Rygel.HTTPTimeSeekRequest (message, handler, null);
+        new Rygel.HTTPTimeSeekRequest (message, handler, null);
         assert_not_reached ();
-    } catch (Rygel.HTTPSeekRequestError e) {
+    } catch (Error e) {
         // Pass - we only expect a HTTPSeekRequestError
         assert (e is Rygel.HTTPSeekRequestError.INVALID_RANGE);
-    } catch (Error e) {
-        assert_not_reached ();
     }
 
     // Test empty header
     message.request_headers.replace (Rygel.HTTPTimeSeekRequest.TIMESEEKRANGE_HEADER, "npt=kjalsjd lsdjldskj 
lkfdsj ");
     try {
-        var request = new Rygel.HTTPTimeSeekRequest (message, handler, null);
+        new Rygel.HTTPTimeSeekRequest (message, handler, null);
         assert_not_reached ();
-    } catch (Rygel.HTTPSeekRequestError e) {
+    } catch (Error e) {
         // Pass - we only expect a HTTPSeekRequestError
         assert (e is Rygel.HTTPSeekRequestError.INVALID_RANGE);
-    } catch (Error e) {
-        assert_not_reached ();
     }
 
     // Must not have white-spaces before npt=
     message.request_headers.replace (Rygel.HTTPTimeSeekRequest.TIMESEEKRANGE_HEADER,
                                      "         npt=0.000-");
     try {
-        var request = new Rygel.HTTPTimeSeekRequest (message, handler, null);
+        new Rygel.HTTPTimeSeekRequest (message, handler, null);
         assert_not_reached ();
-    } catch (Rygel.HTTPSeekRequestError e) {
+    } catch (Error e) {
         // Pass - we only expect a HTTPSeekRequestError
         assert (e is Rygel.HTTPSeekRequestError.INVALID_RANGE);
-    } catch (Error e) {
-        assert_not_reached ();
     }
 
     // Must not have white-spaces in the time
     message.request_headers.replace (Rygel.HTTPTimeSeekRequest.TIMESEEKRANGE_HEADER,
                                      "npt = 00 : 05 : 35.3-00");
     try {
-        var request = new Rygel.HTTPTimeSeekRequest (message, handler, null);
+        new Rygel.HTTPTimeSeekRequest (message, handler, null);
         assert_not_reached ();
-    } catch (Rygel.HTTPSeekRequestError e) {
+    } catch (Error e) {
         // Pass - we only expect a HTTPSeekRequestError
         assert (e is Rygel.HTTPSeekRequestError.INVALID_RANGE);
-    } catch (Error e) {
-        assert_not_reached ();
     }
 }
 


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