fix: refactoring and portability — issues #61, #51, #52
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
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
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user