diff options
author | Stef Walter <stef@thewalter.net> | 2015-11-08 11:20:01 +0100 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2016-02-05 17:06:59 +0100 |
commit | dbae138dc1a30080241cab172a4cf5cf3bb48203 (patch) | |
tree | b70a86528fb98e147404e05d1a417bf39027f86c /src/journal/test-catalog.c | |
parent | c57d67f718077aadee4e2d0940fb87f513b98671 (diff) |
journal: Combine journal catalog entries with the same id
Instead of discarding duplicate catalog entries, we now combine
them. This allows software or admins to add or override catalog
headers, or add additional text to the catalog message.
Diffstat (limited to 'src/journal/test-catalog.c')
-rw-r--r-- | src/journal/test-catalog.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/journal/test-catalog.c b/src/journal/test-catalog.c index 25980b7744..4f1392c218 100644 --- a/src/journal/test-catalog.c +++ b/src/journal/test-catalog.c @@ -46,8 +46,7 @@ static const char *no_catalog_dirs[] = { NULL }; -static void test_import(Hashmap *h, struct strbuf *sb, - const char* contents, ssize_t size, int code) { +static void test_import(Hashmap *h, const char* contents, ssize_t size, int code) { int r; char name[] = "/tmp/test-catalog.XXXXXX"; _cleanup_close_ int fd; @@ -56,7 +55,7 @@ static void test_import(Hashmap *h, struct strbuf *sb, assert_se(fd >= 0); assert_se(write(fd, contents, size) == size); - r = catalog_import_file(h, sb, name); + r = catalog_import_file(h, name); assert_se(r == code); unlink(name); @@ -64,13 +63,11 @@ static void test_import(Hashmap *h, struct strbuf *sb, static void test_catalog_importing(void) { Hashmap *h; - struct strbuf *sb; assert_se(h = hashmap_new(&catalog_hash_ops)); - assert_se(sb = strbuf_new()); #define BUF "xxx" - test_import(h, sb, BUF, sizeof(BUF), -EINVAL); + test_import(h, BUF, sizeof(BUF), -EINVAL); #undef BUF assert_se(hashmap_isempty(h)); log_debug("----------------------------------------"); @@ -80,7 +77,7 @@ static void test_catalog_importing(void) { "Subject: message\n" \ "\n" \ "payload\n" - test_import(h, sb, BUF, sizeof(BUF), -EINVAL); + test_import(h, BUF, sizeof(BUF), -EINVAL); #undef BUF log_debug("----------------------------------------"); @@ -90,7 +87,7 @@ static void test_catalog_importing(void) { "Subject: message\n" \ "\n" \ "payload\n" - test_import(h, sb, BUF, sizeof(BUF), 0); + test_import(h, BUF, sizeof(BUF), 0); #undef BUF assert_se(hashmap_size(h) == 1); @@ -98,7 +95,6 @@ static void test_catalog_importing(void) { log_debug("----------------------------------------"); hashmap_free_free(h); - strbuf_cleanup(sb); } |