chiark / gitweb /
login: rerun vconsole-setup when switching from vgacon to fbcon
[elogind.git] / src / test / test-condition-util.c
index 4ee5600ff6a648131352927c482f51510fd419ea..1c792446af410f549a01136fa5b0063bf1486910 100644 (file)
@@ -45,7 +45,7 @@ static void test_condition_test_host(void) {
         sd_id128_t id;
         int r;
         char sid[SD_ID128_STRING_MAX];
-        char *hostname;
+        _cleanup_free_ char *hostname = NULL;
 
         r = sd_id128_get_machine(&id);
         assert_se(r >= 0);
@@ -95,6 +95,18 @@ static void test_condition_test_architecture(void) {
         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();
@@ -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_kernel_command_line();
 
         return 0;
 }