From d73e0ec2604cf7d1232bc085472e50f8fa433843 Mon Sep 17 00:00:00 2001 From: Alexander Lamaison Date: Thu, 14 Aug 2014 21:10:31 +0100 Subject: [PATCH] Return valid code from test fixture on failure. The sshd test fixture was returning -1 if an error occurred, but negative error codes aren't technically valid (google it). Bash on Windows converted them to 0 which made setup failure look as though all tests were passing. --- tests/ssh2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ssh2.c b/tests/ssh2.c index a668947..f8b6a0d 100644 --- a/tests/ssh2.c +++ b/tests/ssh2.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) if (connect(sock, (struct sockaddr*)(&sin), sizeof(struct sockaddr_in)) != 0) { fprintf(stderr, "failed to connect!\n"); - return -1; + return 1; } /* Create a session instance and start it up @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) session = libssh2_session_init(); if (libssh2_session_startup(session, sock)) { fprintf(stderr, "Failure establishing SSH session\n"); - return -1; + return 1; } /* At this point we havn't authenticated,