[libgee] Remove compilation warnings from tests



commit 96228ad0e049d7b9a4dbfca0fae925eea715c6e2
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Sun Sep 25 21:24:26 2011 +0200

    Remove compilation warnings from tests

 tests/testcase.vala       |    8 ++++----
 tests/testcollection.vala |    4 ----
 tests/testsortedmap.vala  |    2 ++
 3 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/tests/testcase.vala b/tests/testcase.vala
index edcbe04..10ad088 100644
--- a/tests/testcase.vala
+++ b/tests/testcase.vala
@@ -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;
 		}
 
diff --git a/tests/testcollection.vala b/tests/testcollection.vala
index fbf4343..9450d44 100644
--- a/tests/testcollection.vala
+++ b/tests/testcollection.vala
@@ -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();
diff --git a/tests/testsortedmap.vala b/tests/testsortedmap.vala
index 8fcbc40..6fcc440 100644
--- a/tests/testsortedmap.vala
+++ b/tests/testsortedmap.vala
@@ -673,6 +673,8 @@ public abstract class Gee.SortedMapTests : MapTests {
 				contains = {};
 				not_contains = {"one", "two", "three", "four", "five", "six"};
 				break;
+			default:
+				assert_not_reached ();
 			}
 		}
 		



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