From 41d370864ecf4229ee27fc21874b4311a408be74 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 9 Aug 2024 17:17:14 +0200 Subject: [PATCH] tests: Be explicit about types. Casting int to bool might not always work as expected Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/client/torture_auth.c | 4 ++-- tests/client/torture_auth_cert.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/client/torture_auth.c b/tests/client/torture_auth.c index 77b7bd1f..c677b2cd 100644 --- a/tests/client/torture_auth.c +++ b/tests/client/torture_auth.c @@ -729,7 +729,7 @@ static void torture_auth_agent_identities_only(void **state) char bob_ssh_key[1024]; struct passwd *pwd = NULL; int rc; - int identities_only = 1; + bool identities_only = true; char *id = NULL; pwd = getpwnam("bob"); @@ -786,7 +786,7 @@ static void torture_auth_agent_identities_only_protected(void **state) char bob_ssh_key[1024]; struct passwd *pwd; int rc; - int identities_only = 1; + bool identities_only = true; char *id = NULL; pwd = getpwnam("bob"); diff --git a/tests/client/torture_auth_cert.c b/tests/client/torture_auth_cert.c index 29723bcf..f0ad7c95 100644 --- a/tests/client/torture_auth_cert.c +++ b/tests/client/torture_auth_cert.c @@ -587,7 +587,7 @@ torture_auth_agent_cert_identities_only(void **state) ssh_session session = s->ssh.session; char doe_ssh_key[1024]; struct passwd *pwd = NULL; - int identities_only = 1; + bool identities_only = true; char *id = NULL; int rc; @@ -646,7 +646,7 @@ torture_auth_agent_cert_identities_only_nonblocking(void **state) ssh_session session = s->ssh.session; char doe_ssh_key[1024]; struct passwd *pwd = NULL; - int identities_only = 1; + bool identities_only = true; char *id = NULL; int rc; @@ -750,7 +750,7 @@ torture_auth_agent_cert_identities_only_explicit(void **state) char doe_ssh_key[1024]; char doe_ssh_cert[1024]; struct passwd *pwd = NULL; - int identities_only = 1; + bool identities_only = true; char *id = NULL; int rc; @@ -815,7 +815,7 @@ torture_auth_agent_cert_identities_only_nonblocking_explicit(void **state) char doe_ssh_key[1024]; char doe_ssh_cert[1024]; struct passwd *pwd = NULL; - int identities_only = 1; + bool identities_only = true; char *id = NULL; int rc; @@ -887,7 +887,7 @@ torture_auth_agent_cert_only_identities_only(void **state) ssh_session session = s->ssh.session; char doe_ssh_cert[1024]; struct passwd *pwd = NULL; - int identities_only = 1; + bool identities_only = true; char *id = NULL; int rc; @@ -945,7 +945,7 @@ torture_auth_agent_cert_only_identities_only_nonblocking(void **state) ssh_session session = s->ssh.session; char doe_ssh_cert[1024]; struct passwd *pwd = NULL; - int identities_only = 1; + bool identities_only = true; char *id = NULL; int rc;