mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
tests: Unbreak strict builds on Ubuntu
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 9d5616a18c)
This commit is contained in:
committed by
Andreas Schneider
parent
ee7ee2404a
commit
238dbabef8
@@ -157,7 +157,7 @@ static void torture_scp_upload(void **state)
|
|||||||
char expected_a[BUF_SIZE];
|
char expected_a[BUF_SIZE];
|
||||||
char buf[BUF_SIZE];
|
char buf[BUF_SIZE];
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
|
size_t len = 0;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
assert_non_null(state);
|
assert_non_null(state);
|
||||||
@@ -202,7 +202,8 @@ static void torture_scp_upload(void **state)
|
|||||||
file = fopen(buf, "r");
|
file = fopen(buf, "r");
|
||||||
assert_non_null(file);
|
assert_non_null(file);
|
||||||
|
|
||||||
fread(buf, BUF_SIZE, 1, file);
|
len = fread(buf, BUF_SIZE, 1, file);
|
||||||
|
assert_int_equal(len, 1);
|
||||||
assert_memory_equal(buf, expected_a, BUF_SIZE);
|
assert_memory_equal(buf, expected_a, BUF_SIZE);
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
@@ -218,8 +219,8 @@ static void torture_scp_upload_recursive(void **state)
|
|||||||
|
|
||||||
char expected_b[BUF_SIZE];
|
char expected_b[BUF_SIZE];
|
||||||
char buf[BUF_SIZE];
|
char buf[BUF_SIZE];
|
||||||
|
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -273,7 +274,8 @@ static void torture_scp_upload_recursive(void **state)
|
|||||||
file = fopen(buf, "r");
|
file = fopen(buf, "r");
|
||||||
assert_non_null(file);
|
assert_non_null(file);
|
||||||
|
|
||||||
fread(buf, BUF_SIZE, 1, file);
|
len = fread(buf, BUF_SIZE, 1, file);
|
||||||
|
assert_int_equal(len, 1);
|
||||||
assert_memory_equal(buf, expected_b, BUF_SIZE);
|
assert_memory_equal(buf, expected_b, BUF_SIZE);
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
@@ -480,7 +482,7 @@ static void torture_scp_upload_newline(void **state)
|
|||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
char *rs = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
assert_non_null(state);
|
assert_non_null(state);
|
||||||
@@ -531,7 +533,8 @@ static void torture_scp_upload_newline(void **state)
|
|||||||
file = fopen(buf, "r");
|
file = fopen(buf, "r");
|
||||||
assert_non_null(file);
|
assert_non_null(file);
|
||||||
|
|
||||||
fgets(buf, 1024, file);
|
rs = fgets(buf, 1024, file);
|
||||||
|
assert_non_null(rs);
|
||||||
assert_string_equal(buf, "original");
|
assert_string_equal(buf, "original");
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|||||||
Reference in New Issue
Block a user