summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/test-ordered-set.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test-ordered-set.c b/src/test/test-ordered-set.c
index 0d29fcfad2..581b0aa6a1 100644
--- a/src/test/test-ordered-set.c
+++ b/src/test/test-ordered-set.c
@@ -57,7 +57,7 @@ static void test_set_free_with_hash_ops(void) {
static void test_set_put(void) {
_cleanup_ordered_set_free_ OrderedSet *m = NULL;
- _cleanup_free_ char **t = NULL;
+ _cleanup_free_ char **t = NULL, *str = NULL;
m = ordered_set_new(&string_hash_ops);
assert_se(m);
@@ -71,6 +71,9 @@ static void test_set_put(void) {
assert_se(ordered_set_put(m, (void*) "333") == 0);
assert_se(ordered_set_put(m, (void*) "22") == 0);
+ assert_se(str = strdup("333"));
+ assert_se(ordered_set_put(m, str) == -EEXIST);
+
assert_se(t = ordered_set_get_strv(m));
assert_se(streq(t[0], "1"));
assert_se(streq(t[1], "22"));