Skip to content

Commit

Permalink
gio/tests: Guard variable that is used on windows only builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui authored and sdroege committed Apr 8, 2024
1 parent ba8bd34 commit 296f4e0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions gio/src/subclass/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,17 @@ mod tests {
impl ObjectImpl for SimpleApplication {}

impl ApplicationImpl for SimpleApplication {
fn command_line(&self, cmd_line: &crate::ApplicationCommandLine) -> ExitCode {
let arguments = cmd_line.arguments();

// NOTE: on windows argc and argv are ignored, even if the arguments
// were passed explicitly.
//
// Source: https://gitlab.gnome.org/GNOME/glib/-/blob/e64a93269d09302d7a4facbc164b7fe9c2ad0836/gio/gapplication.c#L2513-2515
fn command_line(&self, _cmd_line: &crate::ApplicationCommandLine) -> ExitCode {
#[cfg(not(target_os = "windows"))]
assert_eq!(arguments.to_vec(), &["--global-1", "--global-2"]);

{
let arguments = _cmd_line.arguments();

// NOTE: on windows argc and argv are ignored, even if the arguments
// were passed explicitly.
//
// Source: https://gitlab.gnome.org/GNOME/glib/-/blob/e64a93269d09302d7a4facbc164b7fe9c2ad0836/gio/gapplication.c#L2513-2515
assert_eq!(arguments.to_vec(), &["--global-1", "--global-2"]);
};
EXIT_STATUS.into()
}

Expand Down

0 comments on commit 296f4e0

Please sign in to comment.