diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index a7bce15e..bd7e91bb 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -6,8 +6,13 @@ target_include_directories(client-common INTERFACE "${OPENSSL_INCLUDE_DIR}" "${mosquitto_SOURCE_DIR}" ) + target_sources(client-common INTERFACE ${shared_src}) +if(WITH_TLS) + target_link_libraries(client-common INTERFACE OpenSSL::SSL) +endif() + if(WITH_SRV) target_compile_definitions(client-common INTERFACE "-DWITH_SRV") endif() diff --git a/test/lib/c/fuzzish.c b/test/lib/c/fuzzish.c index dfb7722a..5872a415 100644 --- a/test/lib/c/fuzzish.c +++ b/test/lib/c/fuzzish.c @@ -6,6 +6,8 @@ #include #include +#define UNUSED(A) (void)(A) + static int run = -1; static int proto_ver; @@ -51,6 +53,9 @@ static void on_connect(struct mosquitto *mosq, void *obj, int rc) int mid; mosquitto_property *props = NULL; + UNUSED(mosq); + UNUSED(obj); + if(command){ if(proto_ver == 5){ if(!strncmp(command, "subscribe", strlen("subscribe"))){ @@ -174,25 +179,34 @@ static void on_connect(struct mosquitto *mosq, void *obj, int rc) static void on_connect_with_flags(struct mosquitto *mosq, void *obj, int rc, int flags) { + UNUSED(mosq); + UNUSED(obj); + UNUSED(rc); + UNUSED(flags); } static void on_connect_v5(struct mosquitto *mosq, void *obj, int rc, int flags, const mosquitto_property *props) { + UNUSED(mosq); + UNUSED(obj); + UNUSED(rc); + UNUSED(flags); + prop_test(props); } static void on_disconnect(struct mosquitto *mosq, void *obj, int rc) { - (void)mosq; - (void)obj; + UNUSED(mosq); + UNUSED(obj); run = rc; } static void on_disconnect_v5(struct mosquitto *mosq, void *obj, int rc, const mosquitto_property *props) { - (void)mosq; - (void)obj; + UNUSED(mosq); + UNUSED(obj); prop_test(props); @@ -201,20 +215,34 @@ static void on_disconnect_v5(struct mosquitto *mosq, void *obj, int rc, const mo static void on_publish(struct mosquitto *mosq, void *obj, int mid) { + UNUSED(mosq); + UNUSED(obj); + UNUSED(mid); } static void on_publish_v5(struct mosquitto *mosq, void *obj, int mid, int reason_code, const mosquitto_property *props) { + UNUSED(mosq); + UNUSED(obj); + UNUSED(mid); + UNUSED(reason_code); + prop_test(props); } static void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) { + UNUSED(mosq); + UNUSED(obj); + msg_test(msg); } static void on_message_v5(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg, const mosquitto_property *props) { + UNUSED(mosq); + UNUSED(obj); + msg_test(msg); prop_test(props); } @@ -222,6 +250,11 @@ static void on_message_v5(struct mosquitto *mosq, void *obj, const struct mosqui static void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) { int tot = 0; + + UNUSED(mosq); + UNUSED(obj); + UNUSED(mid); + for(int i=0; i