[tracker/binary-log-2: 33/47] libtracker-db: Finish journal test cases



commit 0969844aba598b5b046028dcfda6cd405a620560
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Jan 6 16:40:26 2010 +0000

    libtracker-db: Finish journal test cases

 tests/libtracker-db/tracker-db-journal.c |   64 ++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)
---
diff --git a/tests/libtracker-db/tracker-db-journal.c b/tests/libtracker-db/tracker-db-journal.c
index d4bfdaf..0778168 100644
--- a/tests/libtracker-db/tracker-db-journal.c
+++ b/tests/libtracker-db/tracker-db-journal.c
@@ -266,6 +266,70 @@ test_read_functions (void)
 	type = tracker_db_journal_reader_get_type ();
 	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_END_TRANSACTION);
 
+	/* Third transaction */
+	result = tracker_db_journal_reader_next (&error);
+	g_assert_no_error (error);
+	g_assert_cmpint (result, ==, TRUE);
+
+	type = tracker_db_journal_reader_get_type ();
+	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_START_TRANSACTION);
+
+	result = tracker_db_journal_reader_next (&error);
+	g_assert_no_error (error);
+	g_assert_cmpint (result, ==, TRUE);
+
+	type = tracker_db_journal_reader_get_type ();
+	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_RESOURCE);
+
+	result = tracker_db_journal_reader_get_resource (&id, &uri);
+	g_assert_cmpint (result, ==, TRUE);
+	g_assert_cmpint (id, ==, 17);
+	g_assert_cmpstr (uri, ==, "http://resource";);
+
+	result = tracker_db_journal_reader_next (&error);
+	g_assert_no_error (error);
+	g_assert_cmpint (result, ==, TRUE);
+
+	type = tracker_db_journal_reader_get_type ();
+	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_RESOURCE);
+
+	result = tracker_db_journal_reader_get_resource (&id, &uri);
+	g_assert_cmpint (result, ==, TRUE);
+	g_assert_cmpint (id, ==, 18);
+	g_assert_cmpstr (uri, ==, "http://predicate";);
+
+	result = tracker_db_journal_reader_next (&error);
+	g_assert_no_error (error);
+	g_assert_cmpint (result, ==, TRUE);
+
+	type = tracker_db_journal_reader_get_type ();
+	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_RESOURCE);
+
+	result = tracker_db_journal_reader_get_resource (&id, &uri);
+	g_assert_cmpint (result, ==, TRUE);
+	g_assert_cmpint (id, ==, 19);
+	g_assert_cmpstr (uri, ==, "http://resource";);
+
+	result = tracker_db_journal_reader_next (&error);
+	g_assert_no_error (error);
+	g_assert_cmpint (result, ==, TRUE);
+
+	type = tracker_db_journal_reader_get_type ();
+	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_INSERT_STATEMENT_ID);
+
+	result = tracker_db_journal_reader_get_statement_id (&s_id, &p_id, &o_id);
+	g_assert_cmpint (result, ==, TRUE);
+	g_assert_cmpint (s_id, ==, 17);
+	g_assert_cmpint (p_id, ==, 18);
+	g_assert_cmpint (o_id, ==, 19);
+
+	result = tracker_db_journal_reader_next (&error);
+	g_assert_no_error (error);
+	g_assert_cmpint (result, ==, TRUE);
+
+	type = tracker_db_journal_reader_get_type ();
+	g_assert_cmpint (type, ==, TRACKER_DB_JOURNAL_END_TRANSACTION);
+
 	/* Shutdown */
 	result = tracker_db_journal_reader_shutdown ();
 	g_assert_cmpint (result, ==, TRUE);



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