1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

tidy-up: example, tests

- drop unnecessary `WIN32`-specific branches.

- add `static`.

- sync header inclusion order.

- sync some common code between examples/tests.

- fix formatting/indentation.

- fix some `checksrc` errors not caught by `checksrc`.

Closes #936
This commit is contained in:
Viktor Szakats
2023-04-08 22:26:10 +00:00
parent 7e4855926e
commit fb9f888308
28 changed files with 343 additions and 409 deletions

View File

@ -221,7 +221,7 @@ LIBSSH2_ALLOC_FUNC(test_alloc)
{
int *threshold_int_ptr = *abstract;
alloc_count++;
if (*abstract != NULL && *threshold_int_ptr == alloc_count) {
if(*abstract != NULL && *threshold_int_ptr == alloc_count) {
return NULL;
}
@ -233,7 +233,7 @@ LIBSSH2_ALLOC_FUNC(test_alloc)
static
LIBSSH2_FREE_FUNC(test_free)
{
(void) abstract;
(void)abstract;
free_count++;
free(ptr);
}
@ -307,10 +307,10 @@ int main(void)
int tc = i + TEST_CASES_LEN + 1;
int malloc_call_num = 5 + i;
test_case(tc,
failed_malloc_test_cases[i].data,
failed_malloc_test_cases[i].data_len,
&malloc_call_num,
failed_malloc_test_cases[i].expected);
failed_malloc_test_cases[i].data,
failed_malloc_test_cases[i].data_len,
&malloc_call_num,
failed_malloc_test_cases[i].expected);
}
return 0;