fix: address CI failures - strict warnings and ASan leaks in tests
CI / lint (pull_request) Successful in 1m4s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / fuzz-build (pull_request) Successful in 12s
CI / coverage (pull_request) Successful in 30s
CI / build-and-test (pull_request) Failing after 1m14s
CI / valgrind (pull_request) Successful in 33s
CI / lint (pull_request) Successful in 1m4s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / fuzz-build (pull_request) Successful in 12s
CI / coverage (pull_request) Successful in 30s
CI / build-and-test (pull_request) Failing after 1m14s
CI / valgrind (pull_request) Successful in 33s
This commit is contained in:
+3
-3
@@ -151,9 +151,10 @@ void handler(int file_descriptor) {
|
|||||||
close(file_descriptor);
|
close(file_descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef FASTSYNC_SERVER_AS_LIB
|
||||||
static Server* g_server = NULL;
|
static Server* g_server = NULL;
|
||||||
|
|
||||||
static void __attribute__((unused)) cleanup(int sig) {
|
static void cleanup(int sig) {
|
||||||
(void)sig;
|
(void)sig;
|
||||||
if (g_server) {
|
if (g_server) {
|
||||||
server_delete(&g_server);
|
server_delete(&g_server);
|
||||||
@@ -161,7 +162,7 @@ static void __attribute__((unused)) cleanup(int sig) {
|
|||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((unused)) print_server_usage(void) {
|
static void print_server_usage(void) {
|
||||||
printf("FastSync Server\n");
|
printf("FastSync Server\n");
|
||||||
printf("Usage: fastsync-server [options]\n");
|
printf("Usage: fastsync-server [options]\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -176,7 +177,6 @@ static void __attribute__((unused)) print_server_usage(void) {
|
|||||||
printf(" --help Show this help\n");
|
printf(" --help Show this help\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FASTSYNC_SERVER_AS_LIB
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
bool use_tls = false;
|
bool use_tls = false;
|
||||||
char* tls_cert = NULL;
|
char* tls_cert = NULL;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ static Config* make_config(const char* version, const char* src, const char* dst
|
|||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
if (!cfg)
|
if (!cfg)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(version);
|
cfg->version = str_dup(version);
|
||||||
cfg->send_directory = str_dup(src);
|
cfg->send_directory = str_dup(src);
|
||||||
cfg->receive_root_directory = str_dup(dst);
|
cfg->receive_root_directory = str_dup(dst);
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ static void test_file_send_receive() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/tmp");
|
cfg->send_directory = str_dup("/tmp");
|
||||||
cfg->receive_root_directory = str_dup("/tmp");
|
cfg->receive_root_directory = str_dup("/tmp");
|
||||||
@@ -306,6 +307,7 @@ static void test_file_send_single_calls_compression() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/tmp");
|
cfg->send_directory = str_dup("/tmp");
|
||||||
cfg->receive_root_directory = str_dup("/tmp");
|
cfg->receive_root_directory = str_dup("/tmp");
|
||||||
@@ -373,6 +375,7 @@ static void test_file_send_single_calls_metadata_and_path() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/tmp");
|
cfg->send_directory = str_dup("/tmp");
|
||||||
cfg->receive_root_directory = str_dup("/tmp");
|
cfg->receive_root_directory = str_dup("/tmp");
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ static void test_sendfile_basic() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/tmp");
|
cfg->send_directory = str_dup("/tmp");
|
||||||
cfg->receive_root_directory = str_dup("/tmp");
|
cfg->receive_root_directory = str_dup("/tmp");
|
||||||
@@ -84,6 +85,7 @@ static void test_sendfile_empty_file() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/tmp");
|
cfg->send_directory = str_dup("/tmp");
|
||||||
cfg->receive_root_directory = str_dup("/tmp");
|
cfg->receive_root_directory = str_dup("/tmp");
|
||||||
@@ -167,6 +169,7 @@ static void test_sendfile_compression_fallback() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/tmp");
|
cfg->send_directory = str_dup("/tmp");
|
||||||
cfg->receive_root_directory = str_dup("/tmp");
|
cfg->receive_root_directory = str_dup("/tmp");
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
static void test_sender_create_destroy() {
|
static void test_sender_create_destroy() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup("1.0");
|
cfg->version = str_dup("1.0");
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/dst");
|
cfg->receive_root_directory = str_dup("/dst");
|
||||||
@@ -42,6 +43,7 @@ static void test_sender_create_destroy() {
|
|||||||
static void test_receiver_create_destroy() {
|
static void test_receiver_create_destroy() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup("2.0");
|
cfg->version = str_dup("2.0");
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/dst");
|
cfg->receive_root_directory = str_dup("/dst");
|
||||||
@@ -65,6 +67,7 @@ static void test_receiver_create_destroy() {
|
|||||||
static void test_sender_queue_capacities() {
|
static void test_sender_queue_capacities() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup("3.0");
|
cfg->version = str_dup("3.0");
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/dst");
|
cfg->receive_root_directory = str_dup("/dst");
|
||||||
@@ -83,6 +86,7 @@ static void test_sender_queue_capacities() {
|
|||||||
static void test_sender_zero_capacity() {
|
static void test_sender_zero_capacity() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup("4.0");
|
cfg->version = str_dup("4.0");
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/dst");
|
cfg->receive_root_directory = str_dup("/dst");
|
||||||
@@ -100,6 +104,7 @@ static void test_sender_zero_capacity() {
|
|||||||
static void test_receiver_fd_zero() {
|
static void test_receiver_fd_zero() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup("5.0");
|
cfg->version = str_dup("5.0");
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/dst");
|
cfg->receive_root_directory = str_dup("/dst");
|
||||||
@@ -115,6 +120,7 @@ static void test_receiver_fd_zero() {
|
|||||||
static void test_receive_thread_finished() {
|
static void test_receive_thread_finished() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/tmp/dst");
|
cfg->receive_root_directory = str_dup("/tmp/dst");
|
||||||
@@ -166,6 +172,7 @@ static void test_receive_thread_finished() {
|
|||||||
static void test_write_thread_done() {
|
static void test_write_thread_done() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/tmp/dst");
|
cfg->receive_root_directory = str_dup("/tmp/dst");
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
static void test_receive_files_finished() {
|
static void test_receive_files_finished() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/tmp/dst");
|
cfg->receive_root_directory = str_dup("/tmp/dst");
|
||||||
@@ -72,6 +73,7 @@ static void test_receive_files_single_file() {
|
|||||||
|
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/tmp/dst");
|
cfg->receive_root_directory = str_dup("/tmp/dst");
|
||||||
@@ -133,6 +135,7 @@ static void test_receive_files_single_file() {
|
|||||||
static void test_receive_files_abort() {
|
static void test_receive_files_abort() {
|
||||||
Config* cfg = config_create();
|
Config* cfg = config_create();
|
||||||
EXPECT_NOT_NULL(cfg);
|
EXPECT_NOT_NULL(cfg);
|
||||||
|
free(cfg->version);
|
||||||
cfg->version = str_dup(PROTOCOL_VERSION);
|
cfg->version = str_dup(PROTOCOL_VERSION);
|
||||||
cfg->send_directory = str_dup("/src");
|
cfg->send_directory = str_dup("/src");
|
||||||
cfg->receive_root_directory = str_dup("/tmp/dst");
|
cfg->receive_root_directory = str_dup("/tmp/dst");
|
||||||
|
|||||||
Reference in New Issue
Block a user