Remove compilation warnings from tests
authorMaciej Piechotka <uzytkownik2@gmail.com>
Sun, 25 Sep 2011 19:24:26 +0000 (21:24 +0200)
committerMaciej Piechotka <uzytkownik2@gmail.com>
Sun, 25 Sep 2011 19:25:09 +0000 (21:25 +0200)
tests/testcase.vala
tests/testcollection.vala
tests/testsortedmap.vala

index edcbe04..10ad088 100644 (file)
@@ -31,8 +31,8 @@ public abstract class Gee.TestCase : Object {
                this.suite = new GLib.TestSuite (name);
        }
 
-       public void add_test (string name, TestMethod test) {
-               var adaptor = new Adaptor (name, test, this);
+       public void add_test (string name, owned TestMethod test) {
+               var adaptor = new Adaptor (name, (owned)test, this);
                this.adaptors += adaptor;
 
                this.suite.add (new GLib.TestCase (adaptor.name,
@@ -58,10 +58,10 @@ public abstract class Gee.TestCase : Object {
                private TestCase test_case;
 
                public Adaptor (string name,
-                               TestMethod test,
+                               owned TestMethod test,
                                TestCase test_case) {
                        this.name = name;
-                       this.test = test;
+                       this.test = (owned)test;
                        this.test_case = test_case;
                }
 
index fbf4343..9450d44 100644 (file)
@@ -907,10 +907,6 @@ public abstract class CollectionTests : Gee.TestCase {
                assert (test_collection.add ("two"));
                assert (test_collection.add ("three"));
 
-               bool one = false;
-               bool two = false;
-               bool three = false;
-
                var iter = test_collection.iterator().chop (1, 1);
                assert (!iter.valid);
                var iter2 = test_collection.iterator();
index 8fcbc40..6fcc440 100644 (file)
@@ -673,6 +673,8 @@ public abstract class Gee.SortedMapTests : MapTests {
                                contains = {};
                                not_contains = {"one", "two", "three", "four", "five", "six"};
                                break;
+                       default:
+                               assert_not_reached ();
                        }
                }