mirror of
https://github.com/systemd/systemd.git
synced 2026-08-05 07:30:30 +00:00
test: use string_hash_ops_free
This commit is contained in:
@@ -110,7 +110,7 @@ TEST(strv_make_nulstr) {
|
||||
}
|
||||
|
||||
TEST(set_make_nulstr) {
|
||||
_cleanup_set_free_free_ Set *set = NULL;
|
||||
_cleanup_set_free_ Set *set = NULL;
|
||||
size_t len = 0;
|
||||
int r;
|
||||
|
||||
@@ -130,7 +130,7 @@ TEST(set_make_nulstr) {
|
||||
static const char expect[] = { 0x00, 0x00 };
|
||||
_cleanup_free_ char *nulstr = NULL;
|
||||
|
||||
set = set_new(NULL);
|
||||
set = set_new(&string_hash_ops_free);
|
||||
assert_se(set);
|
||||
|
||||
r = set_make_nulstr(set, &nulstr, &len);
|
||||
|
||||
@@ -227,14 +227,14 @@ TEST(serialize_item_base64mem) {
|
||||
TEST(serialize_string_set) {
|
||||
_cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-serialize.XXXXXX";
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
_cleanup_set_free_free_ Set *s = NULL;
|
||||
_cleanup_set_free_ Set *s = NULL;
|
||||
_cleanup_free_ char *line1 = NULL, *line2 = NULL;
|
||||
char *p, *q;
|
||||
|
||||
assert_se(fmkostemp_safe(fn, "r+", &f) == 0);
|
||||
log_info("/* %s (%s) */", __func__, fn);
|
||||
|
||||
assert_se(set_ensure_allocated(&s, &string_hash_ops) >= 0);
|
||||
assert_se(set_ensure_allocated(&s, &string_hash_ops_free) >= 0);
|
||||
|
||||
assert_se(serialize_string_set(f, "a", s) == 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user