aboutsummaryrefslogtreecommitdiff
path: root/tests/client
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-02-05 11:26:54 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-05 15:23:19 +0100
commit4bf8ee803282b9d2f6ea11770bab8b8407116b3a (patch)
treeb2e8c9cb973cfdcd5d7be880f4d4eeff5a0ec1dd /tests/client
parent63c42f066fe4c5793309694b61f0bc024f6788c7 (diff)
downloadlibssh-4bf8ee803282b9d2f6ea11770bab8b8407116b3a.tar.gz
libssh-4bf8ee803282b9d2f6ea11770bab8b8407116b3a.tar.xz
libssh-4bf8ee803282b9d2f6ea11770bab8b8407116b3a.zip
tests: Check fgets output.
Diffstat (limited to 'tests/client')
-rw-r--r--tests/client/torture_knownhosts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/client/torture_knownhosts.c b/tests/client/torture_knownhosts.c
index 8f9db8ee..ed1f3116 100644
--- a/tests/client/torture_knownhosts.c
+++ b/tests/client/torture_knownhosts.c
@@ -47,6 +47,7 @@ static void teardown(void **state) {
static void torture_knownhosts_port(void **state) {
ssh_session session = *state;
char buffer[200];
+ char *p;
FILE *file;
int rc;
@@ -69,7 +70,8 @@ static void torture_knownhosts_port(void **state) {
file = fopen(KNOWNHOSTFILES, "r");
assert_true(file != NULL);
- fgets(buffer, sizeof(buffer), file);
+ p = fgets(buffer, sizeof(buffer), file);
+ assert_false(p == NULL)
fclose(file);
buffer[sizeof(buffer) - 1] = '\0';
assert_true(strstr(buffer,"[localhost]:1234 ") != NULL);