run-test: Fix coding style errors

The original code was likely copied from gjs' console code at the
time, which means that its coding style sneaked in.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
This commit is contained in:
Florian Müllner
2025-01-16 12:25:33 +01:00
committed by Marge Bot
parent fecd5cdd6c
commit 696bd09d18

View File

@ -37,7 +37,7 @@
#include "shell-global-private.h" #include "shell-global-private.h"
int int
main(int argc, char **argv) main (int argc, char **argv)
{ {
GOptionContext *context; GOptionContext *context;
GError *error = NULL; GError *error = NULL;
@ -67,15 +67,17 @@ main(int argc, char **argv)
/* prepare command line arguments */ /* prepare command line arguments */
if (!gjs_context_define_string_array (js_context, "ARGV", if (!gjs_context_define_string_array (js_context, "ARGV",
argc - 2, (const char**)argv + 2, argc - 2, (const char**)argv + 2,
&error)) { &error))
g_printerr ("Failed to defined ARGV: %s", error->message); {
exit (1); g_printerr ("Failed to defined ARGV: %s", error->message);
} exit (1);
}
if (argc < 2) { if (argc < 2)
g_printerr ("Missing filename"); {
exit(1); g_printerr ("Missing filename");
} exit (1);
}
filename = argv[1]; filename = argv[1];
title = g_filename_display_basename (filename); title = g_filename_display_basename (filename);
@ -85,11 +87,12 @@ main(int argc, char **argv)
error = NULL; error = NULL;
/* evaluate the script */ /* evaluate the script */
bool success = gjs_context_eval_module_file(js_context, filename, &code, &error); bool success = gjs_context_eval_module_file (js_context, filename, &code, &error);
if (!success) { if (!success)
g_printerr ("%s\n", error->message); {
exit (1); g_printerr ("%s\n", error->message);
} exit (1);
}
gjs_context_gc (js_context); gjs_context_gc (js_context);
gjs_context_gc (js_context); gjs_context_gc (js_context);