[tracker] libtracker-miner: Fix and enable tracker-miner-manager test



commit 7cd5c64d1ce1cf726fa26271915c209f60f11aaf
Author: Jürg Billeter <j bitron ch>
Date:   Wed Mar 17 20:41:45 2010 +0100

    libtracker-miner: Fix and enable tracker-miner-manager test

 tests/libtracker-miner/Makefile.am             |    3 +-
 tests/libtracker-miner/tracker-miner-mock.vala |   29 +++++++++++++----------
 2 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/tests/libtracker-miner/Makefile.am b/tests/libtracker-miner/Makefile.am
index a45a79e..f5c700c 100644
--- a/tests/libtracker-miner/Makefile.am
+++ b/tests/libtracker-miner/Makefile.am
@@ -2,8 +2,7 @@ include $(top_srcdir)/Makefile.decl
 
 noinst_PROGRAMS = $(TEST_PROGS)
 
-TEST_PROGS += tracker-crawler tracker-thumbnailer-test
-# TEST_PPROGS += tracker-miner-manager
+TEST_PROGS += tracker-crawler tracker-thumbnailer-test tracker-miner-manager
 
 INCLUDES = 									\
 	-DTEST									\
diff --git a/tests/libtracker-miner/tracker-miner-mock.vala b/tests/libtracker-miner/tracker-miner-mock.vala
index 39f666e..5cc6ce7 100644
--- a/tests/libtracker-miner/tracker-miner-mock.vala
+++ b/tests/libtracker-miner/tracker-miner-mock.vala
@@ -5,17 +5,20 @@ public class TrackerMinerMock : GLib.Object {
     public bool is_paused ;
     public string pause_reason { get; set; default = ""; }
     public string name { get; set; default = ""; } 
-    public string[] apps {get; set; }
-    public string[] reasons {get; set; }
+    public string[] apps { get { return _apps; } }
+    public string[] reasons { get { return _apps; } }
 
     public signal void progress (string miner, string status, double progress);
     public signal void paused ();
     public signal void resumed ();
 
+    string[] _apps;
+    string[] _reasons;
+
     public TrackerMinerMock (string name) {
         this.name = name;
-        this.apps = {};
-        this.reasons = {};
+        this._apps = {};
+        this._reasons = {};
     }
 
     public void set_paused (bool paused) { this.is_paused = paused; }
@@ -23,26 +26,26 @@ public class TrackerMinerMock : GLib.Object {
 
     public void pause (string app, string reason) {
 
-        if (this.apps == null) {
-            this.apps = { app };
+        if (this._apps.length == 0) {
+            this._apps = { app };
         } else {
-            //this.apps += app;
+            this._apps += app;
         }
 
-        if (this.reasons == null) {
-            this.reasons = { reason };
+        if (this._reasons.length == 0) {
+            this._reasons = { reason };
         } else {
-            //this.reasons += reason;
+            this._reasons += reason;
         }
         this.is_paused = true;
         this.paused ();
     }
 
     public void resume () {
-        this.apps = null;
-        this.reasons = null;
+        this._apps = null;
+        this._reasons = null;
         this.is_paused = false;
         this.resumed ();
     }
 
-}
\ No newline at end of file
+}



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