[tracker] Add license and explanations



commit 9eeeb5c7154a371aa92f9c6c7e84b98006ba3803
Author: Ivan Frade <ivan frade nokia com>
Date:   Wed Apr 29 15:48:00 2009 +0300

    Add license and explanations
    
    Add license to the source code files and explain in comments what the
    mocks are doing.
---
 tests/libtracker-common/mock-dbus-gproxy.c      |    5 ++++
 tests/libtracker-common/mock-dbus-gproxy.h      |   16 ++++++++++++-
 tests/libtracker-common/mock-thumbnailer-dbus.c |   27 +++++++++++++++++++---
 3 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/tests/libtracker-common/mock-dbus-gproxy.c b/tests/libtracker-common/mock-dbus-gproxy.c
index ab814ac..03f34d9 100644
--- a/tests/libtracker-common/mock-dbus-gproxy.c
+++ b/tests/libtracker-common/mock-dbus-gproxy.c
@@ -1,3 +1,8 @@
+/*
+ * To simulate a DBusGProxy in the unit tests, we need a GObject (dbus 
+ * disconnection does a g_object_unref (). This is a GObject with only 
+ * one attribute (an integer), generated with vala.
+ */
 
 #include "mock-dbus-gproxy.h"
 
diff --git a/tests/libtracker-common/mock-dbus-gproxy.h b/tests/libtracker-common/mock-dbus-gproxy.h
index 687e855..dc02186 100644
--- a/tests/libtracker-common/mock-dbus-gproxy.h
+++ b/tests/libtracker-common/mock-dbus-gproxy.h
@@ -1,4 +1,18 @@
-
+/*
+ * To simulate a DBusGProxy in the unit tests, we need a GObject (dbus 
+ * disconnection does a g_object_unref (). This is a GObject with only 
+ * one attribute (an integer), generated with the following vala code:
+ * (command-line: valac -C mock-dbus-gproxy.vala)
+ *
+ *    using GLib;
+ *
+ *    public class MockDBusGProxy : GLib.Object {
+ *      public int id = 1;
+ *    }
+ *
+ *
+ * Modify this code as long as the final result is still a GObject.
+ */
 #ifndef __MOCK_DBUS_GPROXY_H__
 #define __MOCK_DBUS_GPROXY_H__
 
diff --git a/tests/libtracker-common/mock-thumbnailer-dbus.c b/tests/libtracker-common/mock-thumbnailer-dbus.c
index 3a66603..f7d0f37 100644
--- a/tests/libtracker-common/mock-thumbnailer-dbus.c
+++ b/tests/libtracker-common/mock-thumbnailer-dbus.c
@@ -1,3 +1,26 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia (urho konttori nokia com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+/*
+ * Overload of some dbus functions to test tracker-thumbnailer.
+ */
 #include <glib.h>
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
@@ -7,7 +30,6 @@
 DBusGConnection* 
 dbus_g_bus_get (DBusBusType type, GError **error)
 {
-        //g_print ("Calling the right function %s\n", __func__);
         return (DBusGConnection *)g_strdup ("mock connection");
 }
 
@@ -17,7 +39,6 @@ dbus_g_proxy_new_for_name (DBusGConnection *connection,
                            const char *path,
                            const char *interface)
 {
-        //g_print ("Calling the right function %s\n", __func__);
         return (DBusGProxy *)mock_dbus_gproxy_new ();
 }
 
@@ -30,7 +51,6 @@ dbus_g_proxy_call (DBusGProxy *proxy,
 {
         va_list args;
 
-        //g_print ("Calling the right function %s\n", __func__);
         g_message ("DBUS-CALL: %s", method);
 
         va_start (args, first_arg_type);
@@ -55,7 +75,6 @@ dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
                             const char *method, 
                             GType first_arg_type,...)
 {
-
         g_message ("DBUS-CALL: %s", method);
 }
 



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