aboutsummaryrefslogtreecommitdiff
path: root/tests/client/torture_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/client/torture_session.c')
-rw-r--r--tests/client/torture_session.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/client/torture_session.c b/tests/client/torture_session.c
index d397cb16..72b956dd 100644
--- a/tests/client/torture_session.c
+++ b/tests/client/torture_session.c
@@ -177,16 +177,16 @@ static void torture_max_sessions(void **state)
{
struct torture_state *s = *state;
ssh_session session = s->ssh.session;
- ssh_channel channels[11];
-
+#define MAX_CHANNELS 10
+ ssh_channel channels[MAX_CHANNELS + 1];
+ size_t i;
int rc;
- int i;
/* Update server configuration to limit number of sessions */
torture_update_sshd_config(state, "MaxSessions 10");
/* Open the maximum number of channel sessions */
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < MAX_CHANNELS; i++) {
channels[i] = ssh_channel_new(session);
assert_non_null(channels[i]);
@@ -205,10 +205,11 @@ static void torture_max_sessions(void **state)
ssh_channel_free(channels[i]);
/* Close and free channels */
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < MAX_CHANNELS; i++) {
ssh_channel_close(channels[i]);
ssh_channel_free(channels[i]);
}
+#undef MAX_CHANNELS
}
int torture_run_tests(void) {