[gnome-logs/wip/test] Return the journal entry data using g_strdup
- From: Rashi Aswani <aswanirashi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-logs/wip/test] Return the journal entry data using g_strdup
- Date: Thu, 9 Jul 2015 11:25:57 +0000 (UTC)
commit 1ed3d1564b67702d82da71d483ae19f4951e56c4
Author: Rashi Aswani <aswanirashi19 gmail com>
Date: Thu Jul 9 16:51:03 2015 +0530
Return the journal entry data using g_strdup
tests/gl-mock-journal.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/tests/gl-mock-journal.c b/tests/gl-mock-journal.c
index b535aca..0d321d3 100644
--- a/tests/gl-mock-journal.c
+++ b/tests/gl-mock-journal.c
@@ -127,25 +127,25 @@ gl_mock_journal_get_data (GlMockJournal *self,
g_return_val_if_fail (field != NULL, NULL);
if (strcmp(field,"MESSAGE")==0)
- return "This is a test";
+ return g_strdup("This is a test");
if (strcmp(field,"PRIORITY")==0)
- return "3";
+ return g_strdup("3");
if(strcmp(field,"_COMM")==0)
- return "dnf";
+ return g_strdup("dnf");
if(strcmp(field,"KERNEL_DEVICE")==0)
- return "c189:3";
+ return g_strdup("c189:3");
if(strcmp(field,"AUDIT_SESSION")==0)
- return "1";
+ return g_strdup("1");
if(strcmp(field,"TRANSPORT")==0)
- return "Transport";
+ return g_strdup("Transport");
if(strcmp(field,"UID")==0)
- return "0001";
+ return g_strdup("0001");
return NULL;
}
@@ -156,13 +156,18 @@ gl_mock_journal_query_entry (GlMockJournal *self)
GError *error = NULL;
entry = g_object_new (GL_TYPE_MOCK_JOURNAL_ENTRY, NULL);
-
+
+ entry->timestamp = g_strdup("12");
+ entry->cursor = g_strdup("start");
+ entry->catalog = g_strdup("test");
entry->message = gl_mock_journal_get_data (self, "MESSAGE", NULL);
if (error != NULL)
{
g_warning ("%s", error->message);
g_clear_error (&error);
+ free (entry->cursor);
+ free (entry->catalog);
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]