summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ce14025)
raw | patch | inline | side by side (parent: ce14025)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 4 Jun 2016 16:25:06 +0000 (18:25 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 4 Jun 2016 16:30:49 +0000 (18:30 +0200) |
src/utils_mount_test.c | patch | blob | history |
diff --git a/src/utils_mount_test.c b/src/utils_mount_test.c
index d9d685ae7bf09fafca10fb1278a97d0fb84a6d87..dc6f79f9b8f3e2f5ae28296aee5cad414f5788a6 100644 (file)
--- a/src/utils_mount_test.c
+++ b/src/utils_mount_test.c
*/
#include "collectd.h"
+#include "common.h"
#include "testing.h"
#include "utils_mount.h"
{
char line_opts[] = "foo=one,bar=two,qux=three";
char line_bool[] = "one,two,three";
-
- EXPECT_EQ_STR ("one", cu_mount_getoptionvalue (line_opts, "foo="));
- EXPECT_EQ_STR ("two", cu_mount_getoptionvalue (line_opts, "bar="));
- EXPECT_EQ_STR ("three", cu_mount_getoptionvalue (line_opts, "qux="));
- OK (NULL == cu_mount_getoptionvalue (line_opts, "unknown="));
-
- EXPECT_EQ_STR ("", cu_mount_getoptionvalue (line_bool, "one"));
- EXPECT_EQ_STR ("", cu_mount_getoptionvalue (line_bool, "two"));
- EXPECT_EQ_STR ("", cu_mount_getoptionvalue (line_bool, "three"));
- OK (NULL == cu_mount_getoptionvalue (line_bool, "four"));
+ char *v;
+
+ EXPECT_EQ_STR ("one", v = cu_mount_getoptionvalue (line_opts, "foo="));
+ sfree (v);
+ EXPECT_EQ_STR ("two", v = cu_mount_getoptionvalue (line_opts, "bar="));
+ sfree (v);
+ EXPECT_EQ_STR ("three", v = cu_mount_getoptionvalue (line_opts, "qux="));
+ sfree (v);
+ OK (NULL == (v = cu_mount_getoptionvalue (line_opts, "unknown=")));
+ sfree (v);
+
+ EXPECT_EQ_STR ("", v = cu_mount_getoptionvalue (line_bool, "one"));
+ sfree (v);
+ EXPECT_EQ_STR ("", v = cu_mount_getoptionvalue (line_bool, "two"));
+ sfree (v);
+ EXPECT_EQ_STR ("", v = cu_mount_getoptionvalue (line_bool, "three"));
+ sfree (v);
+ OK (NULL == (v = cu_mount_getoptionvalue (line_bool, "four")));
+ sfree (v);
return (0);
}