From 05522148da17cf40218b66189ec7f6b88b485ed5 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Wed, 31 Jan 2024 11:27:02 -0800 Subject: [PATCH] Remove config include from header core_mqtt_serializer.h included the user coreMQTT config, which spills the config header's contents into all consumers of coreMQTT's headers. Macros from the config are no longer used in the the API, so this is also no longer used for anything, so can be removed. --- source/include/core_mqtt_serializer.h | 12 ------------ test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c | 1 + test/cbmc/proofs/MQTT_Publish/MQTT_Publish_harness.c | 1 + .../proofs/MQTT_Subscribe/MQTT_Subscribe_harness.c | 1 + .../MQTT_Unsubscribe/MQTT_Unsubscribe_harness.c | 1 + test/unit-test/core_mqtt_utest.c | 2 ++ 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/source/include/core_mqtt_serializer.h b/source/include/core_mqtt_serializer.h index da2e7e4ed..f9d4cf920 100644 --- a/source/include/core_mqtt_serializer.h +++ b/source/include/core_mqtt_serializer.h @@ -42,18 +42,6 @@ #endif /* *INDENT-ON */ -/* MQTT_DO_NOT_USE_CUSTOM_CONFIG allows building the MQTT library - * without a custom config. If a custom config is provided, the - * MQTT_DO_NOT_USE_CUSTOM_CONFIG macro should not be defined. */ -#ifndef MQTT_DO_NOT_USE_CUSTOM_CONFIG - /* Include custom config file before other headers. */ - #include "core_mqtt_config.h" -#endif - -/* Include config defaults header to get default values of configs not - * defined in core_mqtt_config.h file. */ -#include "core_mqtt_config_defaults.h" - #include "transport_interface.h" /* MQTT packet types. */ diff --git a/test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c b/test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c index dce4d5642..7673ad311 100644 --- a/test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c +++ b/test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c @@ -28,6 +28,7 @@ */ #include "core_mqtt.h" #include "mqtt_cbmc_state.h" +#include "core_mqtt_config_defaults.h" /** * @brief Implement a get time function to return timeout after certain diff --git a/test/cbmc/proofs/MQTT_Publish/MQTT_Publish_harness.c b/test/cbmc/proofs/MQTT_Publish/MQTT_Publish_harness.c index 68d923be5..4f210e359 100644 --- a/test/cbmc/proofs/MQTT_Publish/MQTT_Publish_harness.c +++ b/test/cbmc/proofs/MQTT_Publish/MQTT_Publish_harness.c @@ -28,6 +28,7 @@ */ #include "core_mqtt.h" #include "mqtt_cbmc_state.h" +#include "core_mqtt_config_defaults.h" /** * @brief Implement a get time function to return timeout after certain diff --git a/test/cbmc/proofs/MQTT_Subscribe/MQTT_Subscribe_harness.c b/test/cbmc/proofs/MQTT_Subscribe/MQTT_Subscribe_harness.c index 6798c1c0c..113936018 100644 --- a/test/cbmc/proofs/MQTT_Subscribe/MQTT_Subscribe_harness.c +++ b/test/cbmc/proofs/MQTT_Subscribe/MQTT_Subscribe_harness.c @@ -28,6 +28,7 @@ */ #include "core_mqtt.h" #include "mqtt_cbmc_state.h" +#include "core_mqtt_config_defaults.h" /** * @brief Implement a get time function to return timeout after certain diff --git a/test/cbmc/proofs/MQTT_Unsubscribe/MQTT_Unsubscribe_harness.c b/test/cbmc/proofs/MQTT_Unsubscribe/MQTT_Unsubscribe_harness.c index a441c662d..ef26b2bcf 100644 --- a/test/cbmc/proofs/MQTT_Unsubscribe/MQTT_Unsubscribe_harness.c +++ b/test/cbmc/proofs/MQTT_Unsubscribe/MQTT_Unsubscribe_harness.c @@ -28,6 +28,7 @@ */ #include "core_mqtt.h" #include "mqtt_cbmc_state.h" +#include "core_mqtt_config_defaults.h" /** * @brief Implement a get time function to return timeout after certain diff --git a/test/unit-test/core_mqtt_utest.c b/test/unit-test/core_mqtt_utest.c index d647fd2d5..3e506f644 100644 --- a/test/unit-test/core_mqtt_utest.c +++ b/test/unit-test/core_mqtt_utest.c @@ -38,6 +38,8 @@ #include "mock_core_mqtt_serializer.h" #include "mock_core_mqtt_state.h" +#include "core_mqtt_config_defaults.h" + /* Set network context to double pointer to buffer (uint8_t**). */ struct NetworkContext {