chiark / gitweb /
condition: rewrite condition_test_kernel_command_line() based on unquote_first_word()
[elogind.git] / src / test / test-condition-util.c
index 35ee9167bffb83936acd36c088373c3379b0390c..1c792446af410f549a01136fa5b0063bf1486910 100644 (file)
@@ -95,6 +95,18 @@ static void test_condition_test_architecture(void) {
         condition_free(condition);
 }
 
         condition_free(condition);
 }
 
+static void test_condition_test_kernel_command_line(void) {
+        Condition *condition;
+
+        condition = condition_new(CONDITION_KERNEL_COMMAND_LINE, "thisreallyshouldntbeonthekernelcommandline", false, false);
+        assert_se(!condition_test_kernel_command_line(condition));
+        condition_free(condition);
+
+        condition = condition_new(CONDITION_KERNEL_COMMAND_LINE, "andthis=neither", false, false);
+        assert_se(!condition_test_kernel_command_line(condition));
+        condition_free(condition);
+}
+
 int main(int argc, char *argv[]) {
         log_parse_environment();
         log_open();
 int main(int argc, char *argv[]) {
         log_parse_environment();
         log_open();
@@ -102,6 +114,7 @@ int main(int argc, char *argv[]) {
         test_condition_test_ac_power();
         test_condition_test_host();
         test_condition_test_architecture();
         test_condition_test_ac_power();
         test_condition_test_host();
         test_condition_test_architecture();
+        test_condition_test_kernel_command_line();
 
         return 0;
 }
 
         return 0;
 }