mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
test-set: inline two iterator declarations
This commit is contained in:
parent
3dc6b0fcb2
commit
18e100172c
@ -35,10 +35,9 @@ static void item_seen(Item *item) {
|
|||||||
TEST(set_free_with_destructor) {
|
TEST(set_free_with_destructor) {
|
||||||
Set *m;
|
Set *m;
|
||||||
struct Item items[4] = {};
|
struct Item items[4] = {};
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
assert_se(m = set_new(NULL));
|
assert_se(m = set_new(NULL));
|
||||||
for (i = 0; i < ELEMENTSOF(items) - 1; i++)
|
for (size_t i = 0; i < ELEMENTSOF(items) - 1; i++)
|
||||||
assert_se(set_put(m, items + i) == 1);
|
assert_se(set_put(m, items + i) == 1);
|
||||||
|
|
||||||
m = set_free_with_destructor(m, item_seen);
|
m = set_free_with_destructor(m, item_seen);
|
||||||
@ -53,10 +52,9 @@ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(item_hash_ops, void, trivial_hash_
|
|||||||
TEST(set_free_with_hash_ops) {
|
TEST(set_free_with_hash_ops) {
|
||||||
Set *m;
|
Set *m;
|
||||||
struct Item items[4] = {};
|
struct Item items[4] = {};
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
assert_se(m = set_new(&item_hash_ops));
|
assert_se(m = set_new(&item_hash_ops));
|
||||||
for (i = 0; i < ELEMENTSOF(items) - 1; i++)
|
for (size_t i = 0; i < ELEMENTSOF(items) - 1; i++)
|
||||||
assert_se(set_put(m, items + i) == 1);
|
assert_se(set_put(m, items + i) == 1);
|
||||||
|
|
||||||
m = set_free(m);
|
m = set_free(m);
|
||||||
|
Loading…
Reference in New Issue
Block a user