summaryrefslogtreecommitdiff
path: root/src/journal/test-journal-stream.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-10 22:39:45 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-10 22:41:03 +0200
commitc6511e859c35b12de4e6fb5f58d7258d9de3b8f2 (patch)
treeedec1b14c70ba7bec4869b4ef6f9be8bf16f6a75 /src/journal/test-journal-stream.c
parent934a316cbf68c46f05b7ce0b35fc312eca786747 (diff)
journal: when browsing the journal via browse.html allow clicking on entries to show their details
Diffstat (limited to 'src/journal/test-journal-stream.c')
-rw-r--r--src/journal/test-journal-stream.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/journal/test-journal-stream.c b/src/journal/test-journal-stream.c
index 707dcc178b..caea2b2c63 100644
--- a/src/journal/test-journal-stream.c
+++ b/src/journal/test-journal-stream.c
@@ -39,7 +39,7 @@ static void verify_contents(sd_journal *j, unsigned skip) {
i = 0;
SD_JOURNAL_FOREACH(j) {
const void *d;
- char *k;
+ char *k, *c;
size_t l;
unsigned u;
@@ -61,6 +61,10 @@ static void verify_contents(sd_journal *j, unsigned skip) {
}
free(k);
+
+ assert_se(sd_journal_get_cursor(j, &c) >= 0);
+ assert_se(sd_journal_test_cursor(j, c) > 0);
+ free(c);
}
if (skip > 0)
@@ -122,17 +126,27 @@ int main(int argc, char *argv[]) {
SD_JOURNAL_FOREACH_BACKWARDS(j) {
const void *d;
size_t l;
+ char *c;
assert_se(sd_journal_get_data(j, "NUMBER", &d, &l) >= 0);
printf("\t%.*s\n", (int) l, (const char*) d);
+
+ assert_se(sd_journal_get_cursor(j, &c) >= 0);
+ assert_se(sd_journal_test_cursor(j, c) > 0);
+ free(c);
}
SD_JOURNAL_FOREACH(j) {
const void *d;
size_t l;
+ char *c;
assert_se(sd_journal_get_data(j, "NUMBER", &d, &l) >= 0);
printf("\t%.*s\n", (int) l, (const char*) d);
+
+ assert_se(sd_journal_get_cursor(j, &c) >= 0);
+ assert_se(sd_journal_test_cursor(j, c) > 0);
+ free(c);
}
sd_journal_flush_matches(j);