Files
FastSync/tests/test_transport_ssh.c
T
TapTap c1e1db8f5e
CI / lint (pull_request) Failing after 2s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped
fix: refactoring and portability — issues #61, #51, #52
2026-07-20 18:01:36 +02:00

35 lines
901 B
C

#include "test_transport_ssh.h"
#include "transport_ssh.h"
#include "transport_tcp.h"
#include "test_utils.h"
#include <stdlib.h>
#include <string.h>
static void test_ssh_connect_bad_destination() {
Client* client = client_connect_ssh("nosuchhost.local", 22);
// SSH connection to a non-existent host should fail (return NULL)
EXPECT_NULL(client);
}
static void test_ssh_connect_null_destination() {
Client* client = client_connect_ssh(NULL, 22);
EXPECT_NULL(client);
}
static void test_ssh_connect_bad_port() {
Client* client = client_connect_ssh("localhost", -1);
EXPECT_NULL(client);
}
static void test_ssh_connect_zero_port() {
Client* client = client_connect_ssh("localhost", 0);
EXPECT_NULL(client);
}
void test_transport_ssh() {
test_ssh_connect_bad_destination();
test_ssh_connect_null_destination();
test_ssh_connect_bad_port();
test_ssh_connect_zero_port();
}