[gnome-logs/wip/test] Fix the errors



commit c4aaa87a42a0ce36b4a67a568a2515b1268cbe01
Author: Rashi Aswani <aswanirashi19 gmail com>
Date:   Sat Jul 4 15:41:04 2015 +0530

    Fix the errors

 Makefile.am              |    8 ++++----
 src/gl-application.h     |    5 +++++
 src/gl-eventview.c       |    7 ++++++-
 src/gl-eventview.h       |    6 +++++-
 src/gl-eventviewdetail.h |    7 ++++++-
 src/gl-eventviewlist.c   |    6 ++++++
 src/gl-eventviewlist.h   |    6 +++++-
 src/gl-eventviewrow.c    |    5 +++++
 src/gl-eventviewrow.h    |    8 +++++++-
 src/gl-journal-model.c   |    6 +++++-
 tests/gl-mock-journal.c  |   21 ++++++++++++++++++++-
 tests/gl-mock-journal.h  |   24 +++++++++++++++++++++---
 tests/gnome-logs-test.c  |   11 ++++++-----
 13 files changed, 101 insertions(+), 19 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 11bcece..7564e06 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -145,7 +145,7 @@ tests_test_gl_util_SOURCES = \
        tests/test-gl-util.c \
        src/gl-util.c
 
-tests_gnome_logs_test_CPPFLAGS = \
+tests_gnome_logs_test_CPPFLAGS = -DTEST \
         -DLOCALEDIR=\""$(localedir)"\" \
         -I$(top_builddir) \
         -I$(top_srcdir)/src \
@@ -159,7 +159,6 @@ tests_gnome_logs_test_LDADD = \
 
 tests_gnome_logs_test_SOURCES = \
         tests/gnome-logs-test.c \
-        tests/gl-mock-journal.c \
        src/gl-application.c \
         src/gl-categorylist.c \
         src/gl-eventtoolbar.c \
@@ -167,6 +166,7 @@ tests_gnome_logs_test_SOURCES = \
         src/gl-eventviewdetail.c \
         src/gl-eventviewlist.c \
         src/gl-eventviewrow.c \
+        tests/gl-mock-journal.c \
         src/gl-journal-model.c \
         src/gl-util.c \
         src/gl-window.c
@@ -194,10 +194,10 @@ noinst_tests_gnome_logs_test_headers = \
         src/gl-eventviewdetail.h \
         src/gl-eventviewlist.h \
         src/gl-eventviewrow.h \
+       tests/gl-mock-journal.h \
         src/gl-journal-model.h \
         src/gl-util.h \
-        src/gl-window.h \
-       tests/gl-mock-journal.h
+        src/gl-window.h
 
 nodist_tests_gnome_logs_test_headers = \
         src/gl-enums.h \
diff --git a/src/gl-application.h b/src/gl-application.h
index b254113..2f411cb 100644
--- a/src/gl-application.h
+++ b/src/gl-application.h
@@ -20,6 +20,11 @@
 #define GL_APPLICATION_H_
 
 #include <gtk/gtk.h>
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
 
 G_BEGIN_DECLS
 
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index 2238a9f..fe03c5a 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -28,7 +28,12 @@
 #include "gl-eventtoolbar.h"
 #include "gl-eventviewdetail.h"
 #include "gl-eventviewlist.h"
-#include "gl-journal.h"
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
+
 #include "gl-util.h"
 
 enum
diff --git a/src/gl-eventview.h b/src/gl-eventview.h
index a90906f..41e128f 100644
--- a/src/gl-eventview.h
+++ b/src/gl-eventview.h
@@ -23,7 +23,11 @@
 #include <gtk/gtk.h>
 
 #include "gl-application.h"
-
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
 G_BEGIN_DECLS
 
 /*
diff --git a/src/gl-eventviewdetail.h b/src/gl-eventviewdetail.h
index 7998b9d..05e4e6d 100644
--- a/src/gl-eventviewdetail.h
+++ b/src/gl-eventviewdetail.h
@@ -23,7 +23,12 @@
 
 G_BEGIN_DECLS
 
-#include "gl-journal.h"
+#ifdef TEST
+       #include "../tests/gl-mock-journal.h"
+#else
+       #include "gl-journal.h"
+#endif
+
 #include "gl-util.h"
 
 #define GL_TYPE_EVENT_VIEW_DETAIL (gl_event_view_detail_get_type ())
diff --git a/src/gl-eventviewlist.c b/src/gl-eventviewlist.c
index 9dff73b..527e634 100644
--- a/src/gl-eventviewlist.c
+++ b/src/gl-eventviewlist.c
@@ -30,6 +30,12 @@
 #include "gl-eventviewrow.h"
 #include "gl-journal-model.h"
 #include "gl-util.h"
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
+
 
 struct _GlEventViewList
 {
diff --git a/src/gl-eventviewlist.h b/src/gl-eventviewlist.h
index a9b6d66..31acbb9 100644
--- a/src/gl-eventviewlist.h
+++ b/src/gl-eventviewlist.h
@@ -22,7 +22,11 @@
 #include <gtk/gtk.h>
 
 #include "gl-application.h"
-#include "gl-journal.h"
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
 
 G_BEGIN_DECLS
 
diff --git a/src/gl-eventviewrow.c b/src/gl-eventviewrow.c
index 21fb5aa..3df6bc6 100644
--- a/src/gl-eventviewrow.c
+++ b/src/gl-eventviewrow.c
@@ -21,6 +21,11 @@
 #include <glib/gi18n.h>
 #include <glib-unix.h>
 #include <stdlib.h>
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
 
 #include "gl-enums.h"
 
diff --git a/src/gl-eventviewrow.h b/src/gl-eventviewrow.h
index 4fbba00..85727a6 100644
--- a/src/gl-eventviewrow.h
+++ b/src/gl-eventviewrow.h
@@ -23,7 +23,13 @@
 
 G_BEGIN_DECLS
 
-#include "gl-journal.h"
+#ifdef TEST
+        #include "../tests/gl-mock-journal.h"
+#else
+        #include "gl-journal.h"
+#endif
+
+
 #include "gl-util.h"
 
 /*
diff --git a/src/gl-journal-model.c b/src/gl-journal-model.c
index 2175aec..613fd97 100644
--- a/src/gl-journal-model.c
+++ b/src/gl-journal-model.c
@@ -17,7 +17,11 @@
  */
 
 #include "gl-journal-model.h"
-#include "gl-journal.h"
+#ifdef TEST
+       #include "../tests/gl-mock-journal.h"
+#else
+       #include "gl-journal.h"
+#endif
 
 struct _GlJournalModel
 {
diff --git a/tests/gl-mock-journal.c b/tests/gl-mock-journal.c
index 7808acc..fa3adba 100644
--- a/tests/gl-mock-journal.c
+++ b/tests/gl-mock-journal.c
@@ -17,7 +17,6 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define gl_mock_journal gl_journal
 #include "gl-mock-journal.h"
 
 #include <glib-unix.h>
@@ -36,8 +35,11 @@ struct _GlMockJournalEntry
   gchar *comm;
   gchar *kernel_device;
   gchar *audit_session;
+  gchar *transport;
   gchar *catalog;
   guint priority;
+  gint uid;
+
 };
 
 G_DEFINE_TYPE (GlMockJournalEntry, gl_mock_journal_entry, G_TYPE_OBJECT)
@@ -290,6 +292,14 @@ gl_mock_journal_entry_get_audit_session (GlMockJournalEntry *entry)
 }
 
 const gchar *
+gl_mock_journal_entry_get_transport (GlMockJournalEntry *entry)
+{
+  g_return_val_if_fail (GL_IS_MOCK_JOURNAL_ENTRY (entry), NULL);
+
+  return entry->transport;
+}
+
+const gchar *
 gl_mock_journal_entry_get_catalog (GlMockJournalEntry *entry)
 {
   g_return_val_if_fail (GL_IS_MOCK_JOURNAL_ENTRY (entry), NULL);
@@ -304,3 +314,12 @@ gl_mock_journal_entry_get_priority (GlMockJournalEntry *entry)
 
   return entry->priority;
 }
+
+gint
+gl_mock_journal_entry_get_uid (GlMockJournalEntry *entry)
+{
+  g_return_val_if_fail (GL_IS_MOCK_JOURNAL_ENTRY (entry), -1);
+
+  return entry->uid;
+}
+             
diff --git a/tests/gl-mock-journal.h b/tests/gl-mock-journal.h
index cd961cd..777a2a6 100644
--- a/tests/gl-mock-journal.h
+++ b/tests/gl-mock-journal.h
@@ -17,13 +17,29 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-
 #ifndef GL_MOCK_JOURNAL_H_
 #define GL_MOCK_JOURNAL_H_
 
 #include <gio/gio.h>
-#define gl_mock_journal gl_journal
-
+#define GL_TYPE_JOURNAL_ENTRY GL_TYPE_MOCK_JOURNAL_ENTRY
+#define GlMockJournalEntry GlJournalEntry
+#define GlMockJournalEntryClass GlJournalEntryClass
+#define GlMockJournalClass GlJournalClass
+#define GlMockJournal GlJournal
+#define GlMockJournalPrivate GlJournalPrivate
+#define gl_mock_journal_entry_get_type(GlMockJournalEntry) gl_journal_entry_get_type(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_command_line(GlMockJournalEntry) 
gl_journal_entry_get_command_line(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_timestamp(GlMockJournalEntry) 
gl_journal_entry_get_timestamp(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_message(GlMockJournalEntry) 
gl_journal_entry_get_message(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_audit_session(GlMockJournalEntry) 
gl_journal_entry_get_audit_session(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_kernel_device(GlMockJournalEntry) 
gl_journal_entry_get_kernel_device(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_priority(GlMockJournalEntry) 
gl_journal_entry_get_priority(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_catalog(GlMockJournalEntry) 
gl_journal_entry_get_catalog(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_transport(GlMockJournalEntry) 
gl_journal_entry_get_transport(GlMockJournalEntry)
+#define gl_mock_journal_entry_get_uid(GlMockJournalEntry) gl_journal_entry_get_uid(GlMockJournalEntry) 
+#define gl_mock_journal_previous(GlMockJournal) gl_journal_previous(GlMockJournal)
+#define gl_mock_journal_new(void) gl_journal_new(void)
+#define gl_mock_journal_set_matches gl_journal_set_matches
 G_BEGIN_DECLS
 
 /*
@@ -74,8 +90,10 @@ const gchar *           gl_mock_journal_entry_get_message                    (Gl
 const gchar *           gl_mock_journal_entry_get_command_line               (GlMockJournalEntry *entry);
 const gchar *           gl_mock_journal_entry_get_kernel_device              (GlMockJournalEntry *entry);
 const gchar *           gl_mock_journal_entry_get_audit_session              (GlMockJournalEntry *entry);
+const gchar *           gl_mock_journal_entry_get_transport                  (GlMockJournalEntry *entry);
 const gchar *           gl_mock_journal_entry_get_catalog                    (GlMockJournalEntry *entry);
 guint                   gl_mock_journal_entry_get_priority                   (GlMockJournalEntry *entry);
+gint                    gl_mock_journal_entry_get_uid                        (GlMockJournalEntry *entry);
 
 G_END_DECLS
 
diff --git a/tests/gnome-logs-test.c b/tests/gnome-logs-test.c
index b4784a5..5ac1836 100644
--- a/tests/gnome-logs-test.c
+++ b/tests/gnome-logs-test.c
@@ -15,11 +15,13 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
+#include "gl-mock-journal.h"
 #include "../src/gl-application.h"
 #include "../src/gl-eventviewdetail.h"
 #include "../src/gl-journal-model.h"
@@ -31,12 +33,11 @@
 #include "../src/gl-eventviewrow.h"
 #include "../src/gl-util.h"
 #include "../src/gl-window.h"
-#include "gl-mock-journal.h"
+
 
 static void
 check_log_message (void)
-{
-   
+{  
    GlMockJournal *journal = gl_mock_journal_new();
    GlMockJournalEntry *entry = gl_mock_journal_previous(journal);
    const gchar *mystring = gl_mock_journal_entry_get_message(entry);
@@ -52,12 +53,12 @@ main (int argc, char** argv)
 
     GtkApplication *application;
 
-    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ /*   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
     bind_textdomain_codeset (PACKAGE_TARNAME, "UTF-8");
     textdomain (GETTEXT_PACKAGE);
 
     g_set_prgname (PACKAGE_TARNAME);
-    application = gl_application_new ();
+   */ application = gl_application_new ();
     g_application_run (G_APPLICATION (application), argc, argv);
     g_object_unref (application);
 


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