fix: refactoring and portability — issues #61, #51, #52

This commit is contained in:
2026-07-20 18:01:23 +02:00
parent 504a3a4d4f
commit f256e468a1
28 changed files with 877 additions and 70 deletions
+34
View File
@@ -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();
}