From: Daiki Ueno <ueno@gnu.org>
Date: Tue, 19 Jun 2018 13:39:38 +0200
Subject: tests: Fix memleaks in tests

Applied-Upstream: https://github.com/ueno/libkkc/commit/8fea75f975185cd0270b66c4ad29ae523b2e1763

---
 tests/context.vala  | 6 ++++++
 tests/rom-kana.vala | 1 +
 tests/template.vala | 4 +++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/context.vala b/tests/context.vala
index 9c43dc4..573c566 100644
--- a/tests/context.vala
+++ b/tests/context.vala
@@ -47,6 +47,12 @@ class ContextTests : Kkc.TestCase {
         string input;
         Kkc.KeyEventFilter filter;
 
+        dictionaries = null;
+        candidates = null;
+        segments = null;
+        input = null;
+        rule = null;
+        filter = null;
         context.get ("dictionaries", out dictionaries,
                      "candidates", out candidates,
                      "segments", out segments,
diff --git a/tests/rom-kana.vala b/tests/rom-kana.vala
index 4fff91a..82f93c0 100644
--- a/tests/rom-kana.vala
+++ b/tests/rom-kana.vala
@@ -18,6 +18,7 @@ class RomKanaTests : Kkc.TestCase {
         string pending_output;
         string pending_input;
         Kkc.RomKanaCharacterList produced;
+        rule = null;
         converter.get ("rule", out rule,
                        "kana-mode", out mode,
                        "punctuation-style", out style,
diff --git a/tests/template.vala b/tests/template.vala
index 5900cd1..d087a47 100644
--- a/tests/template.vala
+++ b/tests/template.vala
@@ -7,7 +7,7 @@ class TemplateTests : Kkc.TestCase {
 
     void test_properties () {
         Kkc.Template template;
-        string source;
+        string? source = null;
         bool okuri;
 
         template = new Kkc.SimpleTemplate ("source");
@@ -17,6 +17,7 @@ class TemplateTests : Kkc.TestCase {
         assert (!okuri);
 
         template = new Kkc.OkuriganaTemplate ("かう", 1);
+        source = null;
         template.get ("source", out source,
                       "okuri", out okuri);
 
@@ -24,6 +25,7 @@ class TemplateTests : Kkc.TestCase {
         assert (okuri);
 
         template = new Kkc.NumericTemplate ("だい11かい");
+        source = null;
         template.get ("source", out source,
                       "okuri", out okuri);
 
