summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-30 20:16:51 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-30 22:26:16 +0200
commit765d143b5fc8dcb44f5fbd391ef36d0835793e7c (patch)
tree0fadb3d03d0b7a99412cff9a542f16a66950b5f8 /src/test/test-util.c
parent0e05ee044a6e23745bb8906ad91ec7b97c37dbac (diff)
util: rename parse_cpu_set() to parse_cpu_set_and_warn()
It's pretty untypical for our parsing functions to log on their own. Clarify in the name that this one does.
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r--src/test/test-util.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index f434c5ceba..70c1251729 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -966,7 +966,7 @@ static void test_parse_cpu_set(void) {
int cpu;
/* Simple range (from CPUAffinity example) */
- ncpus = parse_cpu_set("1 2", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("1 2", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus >= 1024);
assert_se(CPU_ISSET_S(1, CPU_ALLOC_SIZE(ncpus), c));
assert_se(CPU_ISSET_S(2, CPU_ALLOC_SIZE(ncpus), c));
@@ -974,7 +974,7 @@ static void test_parse_cpu_set(void) {
c = mfree(c);
/* A more interesting range */
- ncpus = parse_cpu_set("0 1 2 3 8 9 10 11", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("0 1 2 3 8 9 10 11", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus >= 1024);
assert_se(CPU_COUNT_S(CPU_ALLOC_SIZE(ncpus), c) == 8);
for (cpu = 0; cpu < 4; cpu++)
@@ -984,7 +984,7 @@ static void test_parse_cpu_set(void) {
c = mfree(c);
/* Quoted strings */
- ncpus = parse_cpu_set("8 '9' 10 \"11\"", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("8 '9' 10 \"11\"", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus >= 1024);
assert_se(CPU_COUNT_S(CPU_ALLOC_SIZE(ncpus), c) == 4);
for (cpu = 8; cpu < 12; cpu++)
@@ -992,28 +992,28 @@ static void test_parse_cpu_set(void) {
c = mfree(c);
/* Use commas as separators */
- ncpus = parse_cpu_set("0,1,2,3 8,9,10,11", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("0,1,2,3 8,9,10,11", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus < 0);
assert_se(!c);
/* Ranges */
- ncpus = parse_cpu_set("0-3,8-11", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("0-3,8-11", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus < 0);
assert_se(!c);
/* Garbage */
- ncpus = parse_cpu_set("0 1 2 3 garbage", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("0 1 2 3 garbage", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus < 0);
assert_se(!c);
/* Empty string */
c = NULL;
- ncpus = parse_cpu_set("", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus == 0); /* empty string returns 0 */
assert_se(!c);
/* Runnaway quoted string */
- ncpus = parse_cpu_set("0 1 2 3 \"4 5 6 7 ", &c, NULL, "fake", 1, "CPUAffinity");
+ ncpus = parse_cpu_set_and_warn("0 1 2 3 \"4 5 6 7 ", &c, NULL, "fake", 1, "CPUAffinity");
assert_se(ncpus < 0);
assert_se(!c);
}