chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
condition: add more test cases
[elogind.git]
/
src
/
shared
/
condition-util.c
diff --git
a/src/shared/condition-util.c
b/src/shared/condition-util.c
index 7569b40d6d211602a22e9a303d8442885c828f87..749b57712af8054285c014852a24a342a4796987 100644
(file)
--- a/
src/shared/condition-util.c
+++ b/
src/shared/condition-util.c
@@
-45,7
+45,9
@@
Condition* condition_new(ConditionType type, const char *parameter, bool trigger
Condition *c;
int r;
Condition *c;
int r;
+ assert(type >= 0);
assert(type < _CONDITION_TYPE_MAX);
assert(type < _CONDITION_TYPE_MAX);
+ assert(!parameter == (type == CONDITION_NULL));
c = new0(Condition, 1);
if (!c)
c = new0(Condition, 1);
if (!c)
@@
-397,7
+399,6
@@
static int condition_test_file_is_executable(Condition *c) {
static int condition_test_null(Condition *c) {
assert(c);
static int condition_test_null(Condition *c) {
assert(c);
- assert(c->parameter);
assert(c->type == CONDITION_NULL);
/* Note that during parsing we already evaluate the string and
assert(c->type == CONDITION_NULL);
/* Note that during parsing we already evaluate the string and