diff options
author | Richard Hansen <rhansen@rhansen.org> | 2023-04-18 17:49:12 -0400 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2023-04-26 09:33:47 +1200 |
commit | 95ec72e3386b73b0222fdd92dc624501af41efb3 (patch) | |
tree | 3675078e14f1897f71889d59551d62ef6723c2be | |
parent | c4c84413ce4707220da193a59634dc8e0c2cb5b7 (diff) | |
download | lightdm-git-95ec72e3386b73b0222fdd92dc624501af41efb3.tar.gz |
tests: Refactor run_commands for readability
-rw-r--r-- | tests/src/test-runner.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c index 1b961961..01e1455e 100644 --- a/tests/src/test-runner.c +++ b/tests/src/test-runner.c @@ -921,23 +921,24 @@ handle_command (const gchar *command) static void run_commands (void) { - /* Stop daemon if requested */ while (TRUE) { - /* Commands start with an asterisk */ ScriptLine *line = get_script_line (NULL); - if (!line || line->text[0] != '*') - break; + if (!line) + { + quit (EXIT_SUCCESS); + return; + } + + /* Commands start with an asterisk */ + if (line->text[0] != '*') + return; statuses = g_list_append (statuses, g_strdup (line->text)); line->done = TRUE; handle_command (line->text + 1); } - - /* Stop at the end of the script */ - if (get_script_line (NULL) == NULL) - quit (EXIT_SUCCESS); } static gboolean |