diff --git a/api/client/unittest/clientcbtest.cpp b/api/client/unittest/clientcbtest.cpp index 763afe7e1b..3f36d3b235 100644 --- a/api/client/unittest/clientcbtest.cpp +++ b/api/client/unittest/clientcbtest.cpp @@ -28,8 +28,9 @@ #include "tests/gtest/Device.h" #include "tests/gtest/Endpoint.h" +#include "gtest/gtest.h" + #include -#include #include #include #include diff --git a/api/cloud/unittest/cloud_access_test.cpp b/api/cloud/unittest/cloud_access_test.cpp index 58d71946bc..dc8977ac03 100644 --- a/api/cloud/unittest/cloud_access_test.cpp +++ b/api/cloud/unittest/cloud_access_test.cpp @@ -28,7 +28,7 @@ #include "tests/gtest/Device.h" #include "tests/gtest/Endpoint.h" -#include +#include "gtest/gtest.h" class TestCloudAccess : public testing::Test { public: diff --git a/api/cloud/unittest/cloud_context_test.cpp b/api/cloud/unittest/cloud_context_test.cpp index 931f0ebc5e..0977cdb3df 100644 --- a/api/cloud/unittest/cloud_context_test.cpp +++ b/api/cloud/unittest/cloud_context_test.cpp @@ -22,7 +22,7 @@ #include "oc_uuid.h" #include "util/oc_features.h" -#include +#include "gtest/gtest.h" #include class TestCloudContext : public testing::Test { diff --git a/api/cloud/unittest/cloud_manager_test.cpp b/api/cloud/unittest/cloud_manager_test.cpp index 51eba96435..ac5769d7db 100644 --- a/api/cloud/unittest/cloud_manager_test.cpp +++ b/api/cloud/unittest/cloud_manager_test.cpp @@ -33,8 +33,9 @@ #include "tests/gtest/Device.h" #include "tests/gtest/RepPool.h" +#include "gtest/gtest.h" + #include -#include #include #include #include diff --git a/api/cloud/unittest/cloud_rd_test.cpp b/api/cloud/unittest/cloud_rd_test.cpp index d9f143de6e..e495861900 100644 --- a/api/cloud/unittest/cloud_rd_test.cpp +++ b/api/cloud/unittest/cloud_rd_test.cpp @@ -24,7 +24,7 @@ #include "oc_ri.h" #include "tests/gtest/Device.h" -#include +#include "gtest/gtest.h" static constexpr size_t kDeviceID{ 0 }; diff --git a/api/cloud/unittest/cloud_resource_test.cpp b/api/cloud/unittest/cloud_resource_test.cpp index d59dfaa109..66a26036c9 100644 --- a/api/cloud/unittest/cloud_resource_test.cpp +++ b/api/cloud/unittest/cloud_resource_test.cpp @@ -29,8 +29,9 @@ #include "tests/gtest/Resource.h" #include "util/oc_macros_internal.h" +#include "gtest/gtest.h" + #include -#include #include using namespace std::chrono_literals; diff --git a/api/cloud/unittest/cloud_store_test.cpp b/api/cloud/unittest/cloud_store_test.cpp index 28d486c248..ee5df28c16 100644 --- a/api/cloud/unittest/cloud_store_test.cpp +++ b/api/cloud/unittest/cloud_store_test.cpp @@ -35,14 +35,15 @@ #include "tests/gtest/RepPool.h" #include "util/oc_endpoint_address.h" +#include "gtest/gtest.h" + #include #include #include #include -#include +#include #include #include -#include using namespace std::chrono_literals; diff --git a/api/cloud/unittest/cloud_test.cpp b/api/cloud/unittest/cloud_test.cpp index b91c6b2099..f407e8e999 100644 --- a/api/cloud/unittest/cloud_test.cpp +++ b/api/cloud/unittest/cloud_test.cpp @@ -36,12 +36,6 @@ #include "util/oc_secure_string_internal.h" #include "util/oc_features.h" -#include -#include -#include -#include -#include - #ifdef OC_SECURITY #include "security/oc_pstat_internal.h" #include "security/oc_svr_internal.h" @@ -51,6 +45,13 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + +#include +#include +#include +#include + using namespace std::chrono_literals; static constexpr size_t kDeviceID{ 0 }; diff --git a/api/cloud/unittest/rd_client_test.cpp b/api/cloud/unittest/rd_client_test.cpp index 6a2dbd9a98..f975274db5 100644 --- a/api/cloud/unittest/rd_client_test.cpp +++ b/api/cloud/unittest/rd_client_test.cpp @@ -35,8 +35,9 @@ #include "tests/gtest/Endpoint.h" #include "tests/gtest/RepPool.h" +#include "gtest/gtest.h" + #include -#include #include #include #include diff --git a/api/oc_core_res_internal.h b/api/oc_core_res_internal.h index 3e9c212897..d392157e60 100644 --- a/api/oc_core_res_internal.h +++ b/api/oc_core_res_internal.h @@ -27,7 +27,8 @@ #include "port/oc_connectivity_internal.h" #include "util/oc_compiler.h" -#include +#include "cbor.h" + #include #include diff --git a/api/oc_rep_encode_cbor.c b/api/oc_rep_encode_cbor.c index e4da65914b..c980ffa8a6 100644 --- a/api/oc_rep_encode_cbor.c +++ b/api/oc_rep_encode_cbor.c @@ -18,8 +18,6 @@ #include "api/oc_rep_encode_cbor_internal.h" -#include - oc_rep_encoder_implementation_t oc_rep_cbor_encoder(void) { diff --git a/api/oc_rep_encode_internal.h b/api/oc_rep_encode_internal.h index 74b45fb789..7a41f8ddf7 100644 --- a/api/oc_rep_encode_internal.h +++ b/api/oc_rep_encode_internal.h @@ -23,7 +23,8 @@ #include "oc_ri.h" #include "util/oc_compiler.h" -#include +#include "cbor.h" + #include #include #include diff --git a/api/oc_server_api_internal.h b/api/oc_server_api_internal.h index a1be20f5a0..30168c905d 100644 --- a/api/oc_server_api_internal.h +++ b/api/oc_server_api_internal.h @@ -25,7 +25,7 @@ #include "util/oc_compiler.h" #ifdef OC_RES_BATCH_SUPPORT -#include +#include "cbor.h" #endif /* OC_RES_BATCH_SUPPORT */ #include diff --git a/api/oc_tcp.c b/api/oc_tcp.c index 44c5e6641a..6d33e860b8 100644 --- a/api/oc_tcp.c +++ b/api/oc_tcp.c @@ -26,7 +26,7 @@ #include "oc_tcp_internal.h" #include "util/oc_atomic.h" #ifdef OC_SECURITY -#include +#include "mbedtls/ssl.h" #ifdef OC_OSCORE #include "messaging/coap/oscore_internal.h" #endif /* OC_OSCORE */ diff --git a/api/oc_udp.c b/api/oc_udp.c index 7bff038cc9..6e9bc5b0c2 100644 --- a/api/oc_udp.c +++ b/api/oc_udp.c @@ -21,7 +21,7 @@ #include "messaging/coap/coap_internal.h" #include "port/oc_connectivity.h" #ifdef OC_SECURITY -#include +#include "mbedtls/ssl.h" #ifdef OC_OSCORE #include "messaging/coap/oscore_internal.h" #endif /* OC_OSCORE */ diff --git a/api/plgd/plgd_time.c b/api/plgd/plgd_time.c index 1188764e69..0da0e8587e 100644 --- a/api/plgd/plgd_time.c +++ b/api/plgd/plgd_time.c @@ -49,7 +49,7 @@ #include #ifdef OC_SECURITY -#include +#include "mbedtls/x509.h" #endif /* OC_SECURITY */ #ifdef OC_CLIENT diff --git a/api/plgd/plgd_time_internal.h b/api/plgd/plgd_time_internal.h index 2c02f93c12..e97ea110e4 100644 --- a/api/plgd/plgd_time_internal.h +++ b/api/plgd/plgd_time_internal.h @@ -30,7 +30,7 @@ #include "port/oc_clock.h" #ifdef OC_SECURITY -#include +#include "mbedtls/platform_time.h" #endif /* OC_SECURITY */ #include diff --git a/api/unittest/RIServerTest.cpp b/api/unittest/RIServerTest.cpp index fd0bd9862c..efd2cab45a 100644 --- a/api/unittest/RIServerTest.cpp +++ b/api/unittest/RIServerTest.cpp @@ -36,9 +36,10 @@ #include "tests/gtest/Device.h" #include "util/oc_process_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include static const std::string kResourceURI = "/LightResourceURI"; diff --git a/api/unittest/RITest.cpp b/api/unittest/RITest.cpp index 64104a3dc2..f317952486 100644 --- a/api/unittest/RITest.cpp +++ b/api/unittest/RITest.cpp @@ -30,7 +30,8 @@ #include "messaging/coap/signal_internal.h" #endif /* OC_TCP */ -#include +#include "gtest/gtest.h" + #include #include #include diff --git a/api/unittest/base64test.cpp b/api/unittest/base64test.cpp index d19357a030..9d66503f74 100644 --- a/api/unittest/base64test.cpp +++ b/api/unittest/base64test.cpp @@ -19,9 +19,10 @@ #include "oc_base64.h" #include "oc_helpers.h" +#include "gtest/gtest.h" + #include #include -#include #include #include #include diff --git a/api/unittest/buffertest.cpp b/api/unittest/buffertest.cpp index dd22ed131c..4834130547 100644 --- a/api/unittest/buffertest.cpp +++ b/api/unittest/buffertest.cpp @@ -28,7 +28,7 @@ #include "util/oc_memb.h" #include "util/oc_process_internal.h" -#include +#include "gtest/gtest.h" #include constexpr size_t kTestMessagesPoolSize = 1; diff --git a/api/unittest/collectiontest.cpp b/api/unittest/collectiontest.cpp index 054e35a98f..c510fd3da3 100644 --- a/api/unittest/collectiontest.cpp +++ b/api/unittest/collectiontest.cpp @@ -44,10 +44,11 @@ #include "oc_etag.h" #endif /* OC_HAS_FEATURE_ETAG */ +#include "gtest/gtest.h" + #include #include #include -#include #include #include #include diff --git a/api/unittest/conresourcetest.cpp b/api/unittest/conresourcetest.cpp index 1a8cbab874..2b1128b722 100644 --- a/api/unittest/conresourcetest.cpp +++ b/api/unittest/conresourcetest.cpp @@ -28,8 +28,9 @@ #include "tests/gtest/Resource.h" #include "util/oc_macros_internal.h" +#include "gtest/gtest.h" + #include -#include #include #include diff --git a/api/unittest/coreresourcetest.cpp b/api/unittest/coreresourcetest.cpp index d6e447f6c7..56e05af824 100644 --- a/api/unittest/coreresourcetest.cpp +++ b/api/unittest/coreresourcetest.cpp @@ -32,10 +32,11 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include +#include #include -#include -#include #include using namespace std::chrono_literals; diff --git a/api/unittest/discovery/discovery.cpp b/api/unittest/discovery/discovery.cpp index ab6d940136..9c9acaff16 100644 --- a/api/unittest/discovery/discovery.cpp +++ b/api/unittest/discovery/discovery.cpp @@ -36,7 +36,7 @@ #include "tests/gtest/Collection.h" #endif /* OC_COLLECTIONS */ -#include +#include "gtest/gtest.h" namespace oc::discovery { diff --git a/api/unittest/discovery/discovery.h b/api/unittest/discovery/discovery.h index 96487b466d..a2011db334 100644 --- a/api/unittest/discovery/discovery.h +++ b/api/unittest/discovery/discovery.h @@ -28,9 +28,10 @@ #include "messaging/coap/oc_coap.h" #endif /* OC_HAS_FEATURE_ETAG */ +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/api/unittest/discovery/discoverytest.cpp b/api/unittest/discovery/discoverytest.cpp index 2c8652b3d3..7bf9720e8d 100644 --- a/api/unittest/discovery/discoverytest.cpp +++ b/api/unittest/discovery/discoverytest.cpp @@ -42,12 +42,13 @@ #include "security/oc_sdi_internal.h" #endif /* OC_SECURITY */ +#include "gtest/gtest.h" + #include #include #include #include #include -#include #include #include #include diff --git a/api/unittest/encoder/TestEncoderBuffer.h b/api/unittest/encoder/TestEncoderBuffer.h index e7126c6bab..878ae92f0f 100644 --- a/api/unittest/encoder/TestEncoderBuffer.h +++ b/api/unittest/encoder/TestEncoderBuffer.h @@ -24,8 +24,9 @@ #include "oc_rep.h" #include "tests/gtest/RepPool.h" +#include "gtest/gtest.h" + #include -#include #include #include diff --git a/api/unittest/enumstest.cpp b/api/unittest/enumstest.cpp index c0b0e1ba4e..75b5112334 100644 --- a/api/unittest/enumstest.cpp +++ b/api/unittest/enumstest.cpp @@ -18,7 +18,7 @@ #include "api/oc_enums_internal.h" -#include +#include "gtest/gtest.h" #include #include diff --git a/api/unittest/eptest.cpp b/api/unittest/eptest.cpp index 384645e10a..57e473af0f 100644 --- a/api/unittest/eptest.cpp +++ b/api/unittest/eptest.cpp @@ -28,9 +28,10 @@ #include "tests/gtest/Device.h" #include "tests/gtest/Endpoint.h" +#include "gtest/gtest.h" + #include #include -#include #include #include #include diff --git a/api/unittest/etagtest.cpp b/api/unittest/etagtest.cpp index 8c31989eda..11e29f5f4d 100644 --- a/api/unittest/etagtest.cpp +++ b/api/unittest/etagtest.cpp @@ -60,13 +60,14 @@ #include "api/plgd/plgd_time_internal.h" #endif /* OC_HAS_FEATURE_PLGD_TIME */ +#include "gtest/gtest.h" + #include #include #include #include #include #include -#include #include #include #include diff --git a/api/unittest/eventcallbacktest.cpp b/api/unittest/eventcallbacktest.cpp index 43d6a59b05..db7a0ce6bc 100644 --- a/api/unittest/eventcallbacktest.cpp +++ b/api/unittest/eventcallbacktest.cpp @@ -46,8 +46,9 @@ #include "security/oc_security_internal.h" #endif /* OC_SECURITY */ +#include "gtest/gtest.h" + #include -#include #include #include diff --git a/api/unittest/eventstest.cpp b/api/unittest/eventstest.cpp index aff15bb955..7e6e792b48 100644 --- a/api/unittest/eventstest.cpp +++ b/api/unittest/eventstest.cpp @@ -19,7 +19,7 @@ #include "api/oc_events_internal.h" #include "port/oc_log_internal.h" -#include +#include "gtest/gtest.h" class TestEvents : public testing::Test { public: diff --git a/api/unittest/helperstest.cpp b/api/unittest/helperstest.cpp index bb57c2d845..ae4f0e0eee 100644 --- a/api/unittest/helperstest.cpp +++ b/api/unittest/helperstest.cpp @@ -20,10 +20,11 @@ #include "oc_helpers.h" #include "port/oc_random.h" +#include "gtest/gtest.h" + #include #include #include -#include #include #include diff --git a/api/unittest/introspectiontest.cpp b/api/unittest/introspectiontest.cpp index a55e18a128..08d9e23761 100644 --- a/api/unittest/introspectiontest.cpp +++ b/api/unittest/introspectiontest.cpp @@ -34,9 +34,10 @@ #include "tests/gtest/Resource.h" #include "tests/gtest/Storage.h" +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/api/unittest/linktest.cpp b/api/unittest/linktest.cpp index d9c5a45bfd..d52e209ae1 100644 --- a/api/unittest/linktest.cpp +++ b/api/unittest/linktest.cpp @@ -20,7 +20,7 @@ #include "oc_ri.h" #include "port/oc_random.h" -#include +#include "gtest/gtest.h" #include #include diff --git a/api/unittest/logtest.cpp b/api/unittest/logtest.cpp index 8e31d6ab63..5275d81a44 100644 --- a/api/unittest/logtest.cpp +++ b/api/unittest/logtest.cpp @@ -20,9 +20,10 @@ #include "port/oc_log_internal.h" #include "util/oc_compiler.h" +#include "gtest/gtest.h" + #include #include -#include #include class TestLog : public testing::Test { diff --git a/api/unittest/maintenancetest.cpp b/api/unittest/maintenancetest.cpp index e7ec55c07d..fff32fa207 100644 --- a/api/unittest/maintenancetest.cpp +++ b/api/unittest/maintenancetest.cpp @@ -32,7 +32,7 @@ #include "security/oc_pstat_internal.h" #endif /* OC_SECURITY */ -#include +#include "gtest/gtest.h" #include static constexpr size_t kDeviceID{ 0 }; diff --git a/api/unittest/maintest.cpp b/api/unittest/maintest.cpp index 7df3f44fa0..7bd02949e8 100644 --- a/api/unittest/maintest.cpp +++ b/api/unittest/maintest.cpp @@ -27,9 +27,10 @@ #include "util/oc_etimer_internal.h" #include "util/oc_process_internal.h" +#include "gtest/gtest.h" + #include #include -#include #ifdef _WIN32 #include diff --git a/api/unittest/ocapitest.cpp b/api/unittest/ocapitest.cpp index b6e6ce3b96..1d7c8d3fec 100644 --- a/api/unittest/ocapitest.cpp +++ b/api/unittest/ocapitest.cpp @@ -32,10 +32,11 @@ #include "security/oc_acl_internal.h" #endif /* OC_HAS_FEATURE_RESOURCE_ACCESS_IN_RFOTM */ +#include "gtest/gtest.h" + #include #include #include -#include #include #include #include diff --git a/api/unittest/pingtest.cpp b/api/unittest/pingtest.cpp index 5deecb045b..d8b3bfc41f 100644 --- a/api/unittest/pingtest.cpp +++ b/api/unittest/pingtest.cpp @@ -29,8 +29,9 @@ #include "tests/gtest/Device.h" #include "util/oc_process.h" +#include "gtest/gtest.h" + #include -#include using namespace std::chrono_literals; diff --git a/api/unittest/platformtest.cpp b/api/unittest/platformtest.cpp index 2d476118bb..0028e4e86c 100644 --- a/api/unittest/platformtest.cpp +++ b/api/unittest/platformtest.cpp @@ -33,8 +33,9 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include -#include #include #include diff --git a/api/unittest/plgdtimetest.cpp b/api/unittest/plgdtimetest.cpp index 66eb5020a9..d800004374 100644 --- a/api/unittest/plgdtimetest.cpp +++ b/api/unittest/plgdtimetest.cpp @@ -58,15 +58,16 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include #include #include -#include #ifdef OC_SECURITY -#include +#include "mbedtls/platform_time.h" #ifdef OC_PKI -#include +#include "mbedtls/ssl.h" #endif /* OC_PKI */ #endif /* OC_SECURITY */ diff --git a/api/unittest/querytest.cpp b/api/unittest/querytest.cpp index 868fd79676..f994c0a6f7 100644 --- a/api/unittest/querytest.cpp +++ b/api/unittest/querytest.cpp @@ -22,7 +22,7 @@ #include "oc_api.h" #include "oc_ri.h" -#include +#include "gtest/gtest.h" #include #include #include diff --git a/api/unittest/repdecodecbortest.cpp b/api/unittest/repdecodecbortest.cpp index 4b98482171..07d54d6cd8 100644 --- a/api/unittest/repdecodecbortest.cpp +++ b/api/unittest/repdecodecbortest.cpp @@ -25,8 +25,9 @@ #include "tests/gtest/RepPool.h" #include "tests/gtest/Utility.h" +#include "gtest/gtest.h" + #include -#include #include class TestRepDecodeCbor : public testing::Test { diff --git a/api/unittest/repdecodejsontest.cpp b/api/unittest/repdecodejsontest.cpp index 3b8e04ff82..930633691f 100644 --- a/api/unittest/repdecodejsontest.cpp +++ b/api/unittest/repdecodejsontest.cpp @@ -28,7 +28,7 @@ #include "tests/gtest/RepPool.h" #include "tests/gtest/Utility.h" -#include +#include "gtest/gtest.h" #include class TestRepDecodeJson : public testing::Test { diff --git a/api/unittest/repdecodetest.cpp b/api/unittest/repdecodetest.cpp index 3891a8650c..69b74dc3cf 100644 --- a/api/unittest/repdecodetest.cpp +++ b/api/unittest/repdecodetest.cpp @@ -19,7 +19,7 @@ #include "api/oc_rep_decode_internal.h" #include "api/oc_rep_internal.h" -#include +#include "gtest/gtest.h" class TestRepDecode : public testing::Test {}; diff --git a/api/unittest/repencodecbortest.cpp b/api/unittest/repencodecbortest.cpp index 98ef1cd45e..5befcb5268 100644 --- a/api/unittest/repencodecbortest.cpp +++ b/api/unittest/repencodecbortest.cpp @@ -29,10 +29,11 @@ #include "port/oc_log_internal.h" #include "tests/gtest/RepPool.h" -#include +#include "gtest/gtest.h" + +#include #include #include -#include #include #include diff --git a/api/unittest/repencodecrctest.cpp b/api/unittest/repencodecrctest.cpp index 7ea5d53210..7f2abc547d 100644 --- a/api/unittest/repencodecrctest.cpp +++ b/api/unittest/repencodecrctest.cpp @@ -32,10 +32,11 @@ #include "tests/gtest/Utility.h" #include "util/oc_crc_internal.h" +#include "cbor.h" +#include "gtest/gtest.h" + #include -#include #include -#include #include #include diff --git a/api/unittest/repencodejsontest.cpp b/api/unittest/repencodejsontest.cpp index 7abcb0f4e2..c09da16007 100644 --- a/api/unittest/repencodejsontest.cpp +++ b/api/unittest/repencodejsontest.cpp @@ -34,10 +34,11 @@ #include "port/oc_log_internal.h" #include "tests/gtest/RepPool.h" -#include +#include "gtest/gtest.h" + +#include #include #include -#include #include #include diff --git a/api/unittest/repencodetest.cpp b/api/unittest/repencodetest.cpp index 397e902869..de48edbbda 100644 --- a/api/unittest/repencodetest.cpp +++ b/api/unittest/repencodetest.cpp @@ -24,7 +24,8 @@ #include "util/oc_features.h" #include "tests/gtest/RepPool.h" -#include +#include "gtest/gtest.h" + #include #include diff --git a/api/unittest/repjsontest.cpp b/api/unittest/repjsontest.cpp index 666f8791d9..ad590bf59b 100644 --- a/api/unittest/repjsontest.cpp +++ b/api/unittest/repjsontest.cpp @@ -33,9 +33,10 @@ #include "util/oc_memb.h" #include "util/oc_secure_string_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/api/unittest/reptest.cpp b/api/unittest/reptest.cpp index 2028117ecf..78882874e1 100644 --- a/api/unittest/reptest.cpp +++ b/api/unittest/reptest.cpp @@ -26,11 +26,12 @@ #include "tests/gtest/Resource.h" #include "util/oc_secure_string_internal.h" +#include "gtest/gtest.h" + #include +#include #include -#include #include -#include #include #include diff --git a/api/unittest/requestapitest.cpp b/api/unittest/requestapitest.cpp index ecd8b87ec8..c821904ad7 100644 --- a/api/unittest/requestapitest.cpp +++ b/api/unittest/requestapitest.cpp @@ -24,8 +24,9 @@ #include "oc_ri.h" #include "port/oc_random.h" +#include "gtest/gtest.h" + #include -#include #include namespace { diff --git a/api/unittest/resourcetest.cpp b/api/unittest/resourcetest.cpp index 0b501caadf..527dc6b59a 100644 --- a/api/unittest/resourcetest.cpp +++ b/api/unittest/resourcetest.cpp @@ -34,8 +34,9 @@ #include "oc_push.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include -#include #include #include #include diff --git a/api/unittest/storagetest.cpp b/api/unittest/storagetest.cpp index eafef04fc0..d818aff90f 100644 --- a/api/unittest/storagetest.cpp +++ b/api/unittest/storagetest.cpp @@ -33,9 +33,10 @@ #include "port/oc_storage_internal.h" #include "util/oc_macros_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/api/unittest/swupdatetest.cpp b/api/unittest/swupdatetest.cpp index 1150d54a72..871b7461db 100644 --- a/api/unittest/swupdatetest.cpp +++ b/api/unittest/swupdatetest.cpp @@ -46,9 +46,10 @@ #include "security/oc_pstat_internal.h" #endif /* OC_SECURITY */ +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/api/unittest/tcptest.cpp b/api/unittest/tcptest.cpp index 82603e1363..62336451e6 100644 --- a/api/unittest/tcptest.cpp +++ b/api/unittest/tcptest.cpp @@ -31,19 +31,20 @@ #include "messaging/coap/oscore_internal.h" #endif /* OC_OSCORE */ +#include "gtest/gtest.h" + +#ifdef OC_SECURITY +#include "mbedtls/ssl.h" +#endif /* OC_SECURITY */ + #include #include -#include #include #ifdef _WIN32 #include #endif /* _WIN32 */ -#ifdef OC_SECURITY -#include -#endif /* OC_SECURITY */ - class TCPMessage : public testing::Test { public: static void SetUpTestCase() diff --git a/api/unittest/udptest.cpp b/api/unittest/udptest.cpp index e28a50d376..6b84affb75 100644 --- a/api/unittest/udptest.cpp +++ b/api/unittest/udptest.cpp @@ -28,18 +28,18 @@ #include "messaging/coap/oscore_internal.h" #endif /* OC_SECURITY && OC_OSCORE */ +#include "gtest/gtest.h" +#ifdef OC_SECURITY +#include "mbedtls/ssl.h" +#endif /* OC_SECURITY */ + #include #include -#include #ifdef _WIN32 #include #endif /* _WIN32 */ -#ifdef OC_SECURITY -#include -#endif /* OC_SECURITY */ - class UDPMessage : public testing::Test { public: static void SetUpTestCase() diff --git a/api/unittest/uuidtest.cpp b/api/unittest/uuidtest.cpp index 4ed7177d38..3f46a3ed1c 100644 --- a/api/unittest/uuidtest.cpp +++ b/api/unittest/uuidtest.cpp @@ -20,9 +20,10 @@ #include "oc_uuid.h" #include "port/oc_random.h" +#include "gtest/gtest.h" + #include #include -#include #include constexpr const char UUID[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV"; diff --git a/apps/cloud_server.c b/apps/cloud_server.c index bfe886c548..4a786ad159 100644 --- a/apps/cloud_server.c +++ b/apps/cloud_server.c @@ -158,7 +158,7 @@ static const char *auth_code; static const char *sid; static const char *apn; #ifdef OC_PKI -#include +#include "mbedtls/sha256.h" static bool simulate_tpm = false; static uint8_t manufacturer_private_key[4096]; const char *manufacturer_reference_private_key = "IDevID"; diff --git a/include/oc_certs.h b/include/oc_certs.h index f147b15401..83e3686117 100644 --- a/include/oc_certs.h +++ b/include/oc_certs.h @@ -25,10 +25,11 @@ #include "oc_export.h" -#include -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/ecp.h" +#include "mbedtls/md.h" +#include "mbedtls/x509_crt.h" + #include // mask of OCF-supported message digests diff --git a/include/oc_csr.h b/include/oc_csr.h index 2a142b59b3..3e95765465 100644 --- a/include/oc_csr.h +++ b/include/oc_csr.h @@ -23,8 +23,8 @@ #include "oc_export.h" -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/md.h" #include #ifdef __cplusplus diff --git a/include/oc_pki.h b/include/oc_pki.h index 0c6e1bddf5..4f10f18d05 100644 --- a/include/oc_pki.h +++ b/include/oc_pki.h @@ -35,10 +35,11 @@ extern "C" { #include "oc_export.h" #include "oc_sp.h" -#include -#include -#include -#include + +#include "mbedtls/build_info.h" +#include "mbedtls/mbedtls_config.h" +#include "mbedtls/platform_time.h" +#include "mbedtls/x509_crt.h" #include #include diff --git a/include/oc_rep.h b/include/oc_rep.h index 11794caa24..517b4079a6 100644 --- a/include/oc_rep.h +++ b/include/oc_rep.h @@ -22,13 +22,15 @@ #ifndef OC_REP_H #define OC_REP_H -#include #include "oc_config.h" #include "oc_export.h" #include "oc_helpers.h" #include "util/oc_compiler.h" #include "util/oc_memb.h" #include "util/oc_features.h" + +#include "cbor.h" + #include #include #include diff --git a/messaging/coap/unittest/blockwisetest.cpp b/messaging/coap/unittest/blockwisetest.cpp index 3e7e268044..2bb6e7236e 100644 --- a/messaging/coap/unittest/blockwisetest.cpp +++ b/messaging/coap/unittest/blockwisetest.cpp @@ -41,9 +41,10 @@ #include "tests/gtest/Resource.h" #include "util/oc_process_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include using namespace std::chrono_literals; diff --git a/messaging/coap/unittest/coapsignaltest.cpp b/messaging/coap/unittest/coapsignaltest.cpp index 4873717173..52dc7fe275 100644 --- a/messaging/coap/unittest/coapsignaltest.cpp +++ b/messaging/coap/unittest/coapsignaltest.cpp @@ -21,9 +21,10 @@ #include "oc_api.h" #include "oc_endpoint.h" +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/messaging/coap/unittest/observenotificationstest.cpp b/messaging/coap/unittest/observenotificationstest.cpp index 4a4d5f402d..6cc6621459 100644 --- a/messaging/coap/unittest/observenotificationstest.cpp +++ b/messaging/coap/unittest/observenotificationstest.cpp @@ -47,7 +47,8 @@ #include "security/oc_security_internal.h" #endif // OC_SECURITY -#include +#include "gtest/gtest.h" + #include #include #include diff --git a/messaging/coap/unittest/observetest.cpp b/messaging/coap/unittest/observetest.cpp index 32eab2cd36..5fe804d238 100644 --- a/messaging/coap/unittest/observetest.cpp +++ b/messaging/coap/unittest/observetest.cpp @@ -33,8 +33,9 @@ #include "util/oc_list.h" #include "util/oc_mmem_internal.h" +#include "gtest/gtest.h" + #include -#include #include #include diff --git a/messaging/coap/unittest/optionstest.cpp b/messaging/coap/unittest/optionstest.cpp index ac378858e1..8b1fd4f338 100644 --- a/messaging/coap/unittest/optionstest.cpp +++ b/messaging/coap/unittest/optionstest.cpp @@ -20,8 +20,9 @@ #include "messaging/coap/options_internal.h" #include "tests/gtest/Device.h" +#include "gtest/gtest.h" + #include -#include #include class TestOptions : public testing::Test {}; diff --git a/messaging/coap/unittest/tcptest.cpp b/messaging/coap/unittest/tcptest.cpp index 30ed4fa8ad..9a6c12ae1b 100644 --- a/messaging/coap/unittest/tcptest.cpp +++ b/messaging/coap/unittest/tcptest.cpp @@ -24,8 +24,9 @@ #include "messaging/coap/constants.h" #include "messaging/coap/options_internal.h" +#include "gtest/gtest.h" + #include -#include TEST(CoapTCP, ParseLength_0) { diff --git a/port/android/Makefile b/port/android/Makefile index e9aad20c20..367a504733 100644 --- a/port/android/Makefile +++ b/port/android/Makefile @@ -100,6 +100,9 @@ endif DYNAMIC ?= 1 export SECURE ?= 1 export PKI ?= 1 +ifeq ($(SECURE),0) + PKI = 0 +endif IPV4 ?= 1 export TCP ?= 1 export CLOUD ?= 1 diff --git a/port/linux/Makefile b/port/linux/Makefile index a943acc583..ec03106cde 100644 --- a/port/linux/Makefile +++ b/port/linux/Makefile @@ -12,6 +12,9 @@ VERSION = $(VERSION_MAJOR).$(VERSION_MINOR) DYNAMIC ?= 1 export SECURE ?= 1 export PKI ?= 1 +ifeq ($(SECURE),0) + PKI = 0 +endif export OSCORE ?= 1 INTROSPECTION ?= 1 export IDD ?= 1 diff --git a/port/unittest/clocktest.cpp b/port/unittest/clocktest.cpp index bc4679a89f..d969406e1b 100644 --- a/port/unittest/clocktest.cpp +++ b/port/unittest/clocktest.cpp @@ -20,9 +20,10 @@ #include "oc_config.h" #include "port/oc_clock.h" +#include "gtest/gtest.h" + #include #include -#include #include class TestClock : public testing::Test { diff --git a/port/unittest/connectivitytest.cpp b/port/unittest/connectivitytest.cpp index 1a7cc895d6..18226d632f 100644 --- a/port/unittest/connectivitytest.cpp +++ b/port/unittest/connectivitytest.cpp @@ -34,12 +34,13 @@ #include "tests/gtest/Device.h" #include "tests/gtest/Endpoint.h" +#include "gtest/gtest.h" + #include #include #include #include #include -#include #include #include diff --git a/port/unittest/dnstest.cpp b/port/unittest/dnstest.cpp index d926365261..b5ae77cb0d 100644 --- a/port/unittest/dnstest.cpp +++ b/port/unittest/dnstest.cpp @@ -23,7 +23,9 @@ #include "port/oc_connectivity.h" #include "oc_endpoint.h" #include "oc_helpers.h" -#include + +#include "gtest/gtest.h" + #ifdef _WIN32 #include #endif /* _WIN32 */ diff --git a/port/unittest/fcntltest.cpp b/port/unittest/fcntltest.cpp index 7680b6a697..ead452013c 100644 --- a/port/unittest/fcntltest.cpp +++ b/port/unittest/fcntltest.cpp @@ -27,9 +27,10 @@ #include "port/common/posix/oc_fcntl_internal.h" #endif /* !_WIN32 */ +#include "gtest/gtest.h" + #include #include -#include #include #ifdef _WIN32 diff --git a/port/unittest/storagetest.cpp b/port/unittest/storagetest.cpp index 2217c58148..a353d41895 100644 --- a/port/unittest/storagetest.cpp +++ b/port/unittest/storagetest.cpp @@ -36,11 +36,12 @@ #include "port/windows/storage.h" #endif /* _WIN32 */ +#include "gtest/gtest.h" + #include #include #include #include -#include #include #include diff --git a/python/unittest/pythontest.cpp b/python/unittest/pythontest.cpp index 733404e259..7d4d76678d 100644 --- a/python/unittest/pythontest.cpp +++ b/python/unittest/pythontest.cpp @@ -18,8 +18,9 @@ #include "python/oc_python_internal.h" +#include "gtest/gtest.h" + #include -#include #include class ResourceDiscoveryPayloadTest : public ::testing::Test { diff --git a/security/oc_certs.c b/security/oc_certs.c index 6b4a0b1bb2..d16132f535 100644 --- a/security/oc_certs.c +++ b/security/oc_certs.c @@ -33,11 +33,12 @@ #include "security/oc_tls_internal.h" #include "util/oc_macros_internal.h" -#include -#include -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/bignum.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" +#include "mbedtls/oid.h" +#include "mbedtls/pk.h" #include #include diff --git a/security/oc_certs_generate.c b/security/oc_certs_generate.c index a3c6625e2a..250d53bc93 100644 --- a/security/oc_certs_generate.c +++ b/security/oc_certs_generate.c @@ -27,13 +27,14 @@ #include "security/oc_entropy_internal.h" #include "util/oc_macros_internal.h" +#include "mbedtls/build_info.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" +#include "mbedtls/oid.h" +#include "mbedtls/platform.h" +#include "mbedtls/x509_crt.h" + #include -#include -#include -#include -#include -#include -#include #include static bool diff --git a/security/oc_certs_generate_internal.h b/security/oc_certs_generate_internal.h index 2c27675bd6..02cf88b0b3 100644 --- a/security/oc_certs_generate_internal.h +++ b/security/oc_certs_generate_internal.h @@ -27,8 +27,9 @@ #include "oc_role.h" #include "util/oc_compiler.h" -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/x509_crt.h" + #include #ifdef __cplusplus diff --git a/security/oc_certs_internal.h b/security/oc_certs_internal.h index 7cbe760aa8..304beccd48 100644 --- a/security/oc_certs_internal.h +++ b/security/oc_certs_internal.h @@ -25,9 +25,10 @@ #include "oc_role.h" #include "security/oc_cred_internal.h" -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/x509_crt.h" +#include "mbedtls/x509_csr.h" + #include #include diff --git a/security/oc_certs_validate.c b/security/oc_certs_validate.c index 1f1dbfcf0b..dd14e0b82f 100644 --- a/security/oc_certs_validate.c +++ b/security/oc_certs_validate.c @@ -26,9 +26,11 @@ #include "port/oc_log_internal.h" #include "security/oc_certs_internal.h" +#include "mbedtls/build_info.h" +#include "mbedtls/oid.h" +#include "mbedtls/x509_crt.h" + #include -#include -#include #include #define MBEDTLS_ULIMITED_PATHLEN 0 diff --git a/security/oc_certs_validate_internal.h b/security/oc_certs_validate_internal.h index 51464119bc..3a03f27d01 100644 --- a/security/oc_certs_validate_internal.h +++ b/security/oc_certs_validate_internal.h @@ -21,8 +21,9 @@ #if defined(OC_SECURITY) && defined(OC_PKI) -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/x509_crt.h" + #include #ifdef __cplusplus diff --git a/security/oc_cred.c b/security/oc_cred.c index 3186171cea..2cbdc9224c 100644 --- a/security/oc_cred.c +++ b/security/oc_cred.c @@ -47,7 +47,7 @@ #endif /* OC_OSCORE */ #ifdef OC_PKI #include "security/oc_certs_internal.h" -#include +#include "mbedtls/platform_util.h" #endif /* OC_PKI */ #include diff --git a/security/oc_csr.c b/security/oc_csr.c index 20adcffe15..e5ec03c1d3 100644 --- a/security/oc_csr.c +++ b/security/oc_csr.c @@ -36,10 +36,12 @@ #include "security/oc_pki_internal.h" #include "security/oc_tls_internal.h" +#include "mbedtls/build_info.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" +#include "mbedtls/x509_csr.h" + #include -#include -#include -#include static bool csr_init_pk_context(size_t device, mbedtls_pk_context *pk) diff --git a/security/oc_csr_internal.h b/security/oc_csr_internal.h index b4134f33e6..dc1a666fad 100644 --- a/security/oc_csr_internal.h +++ b/security/oc_csr_internal.h @@ -23,8 +23,9 @@ #include "oc_helpers.h" #include "oc_ri.h" -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/x509_csr.h" + #include #include #include diff --git a/security/oc_entropy.c b/security/oc_entropy.c index 64cfe27c1a..e39e86ef50 100644 --- a/security/oc_entropy.c +++ b/security/oc_entropy.c @@ -21,7 +21,8 @@ #include "oc_entropy_internal.h" #include "port/oc_random.h" -#include +#include "mbedtls/entropy.h" + #include #define OC_ENTROPY_MIN 32 diff --git a/security/oc_entropy_internal.h b/security/oc_entropy_internal.h index eca5f3e95e..488eb65547 100644 --- a/security/oc_entropy_internal.h +++ b/security/oc_entropy_internal.h @@ -23,8 +23,9 @@ extern "C" { #endif -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/entropy.h" + #include /// @brief Add oc_entropy_poll to data sources diff --git a/security/oc_keypair.c b/security/oc_keypair.c index d2630c469c..d3fde10452 100644 --- a/security/oc_keypair.c +++ b/security/oc_keypair.c @@ -29,10 +29,11 @@ #include "security/oc_entropy_internal.h" #include "security/oc_pki_internal.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" +#include "mbedtls/pk.h" + #include -#include -#include -#include OC_MEMB(g_oc_keypairs_s, oc_ecdsa_keypair_t, OC_MAX_NUM_DEVICES); OC_LIST(g_oc_keypairs); diff --git a/security/oc_keypair_internal.h b/security/oc_keypair_internal.h index ad45badcf7..f1f33a4ad8 100644 --- a/security/oc_keypair_internal.h +++ b/security/oc_keypair_internal.h @@ -23,7 +23,8 @@ #include "oc_rep.h" -#include +#include "mbedtls/ecp.h" + #include #include diff --git a/security/oc_obt_internal.h b/security/oc_obt_internal.h index 762e6b484c..24a14091f6 100644 --- a/security/oc_obt_internal.h +++ b/security/oc_obt_internal.h @@ -32,8 +32,8 @@ #include "util/oc_compiler.h" #ifdef OC_PKI -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/x509_crt.h" #endif /* OC_PKI */ #include diff --git a/security/oc_oscore_crypto.c b/security/oc_oscore_crypto.c index a1fc73b3d0..2cfc234e08 100644 --- a/security/oc_oscore_crypto.c +++ b/security/oc_oscore_crypto.c @@ -19,12 +19,13 @@ #if defined(OC_SECURITY) && defined(OC_OSCORE) #include "oc_oscore_crypto_internal.h" -#include "mbedtls/ccm.h" -#include "mbedtls/md.h" #include "messaging/coap/oscore_constants.h" #include "oc_rep.h" #include "port/oc_log_internal.h" +#include "mbedtls/ccm.h" +#include "mbedtls/md.h" + #define HMAC_SHA256_HASHLEN (32U) #define HKDF_OUTPUT_MAXLEN (512U) diff --git a/security/oc_oscore_engine.c b/security/oc_oscore_engine.c index 91245e1329..f24a873d4e 100644 --- a/security/oc_oscore_engine.c +++ b/security/oc_oscore_engine.c @@ -35,7 +35,7 @@ #include "oc_tls_internal.h" #include "util/oc_process.h" -#include +#include "mbedtls/ccm.h" #include diff --git a/security/oc_pki.c b/security/oc_pki.c index 31842645d5..45bbaeeda4 100644 --- a/security/oc_pki.c +++ b/security/oc_pki.c @@ -30,9 +30,9 @@ #include "port/oc_connectivity.h" #include "port/oc_log_internal.h" -#include -#include -#include +#include "mbedtls/ecp.h" +#include "mbedtls/pk.h" +#include "mbedtls/x509_crt.h" static oc_pki_verify_certificate_cb_t g_verify_certificate_cb; static oc_pki_pk_functions_t g_pk_functions; diff --git a/security/oc_pki_internal.h b/security/oc_pki_internal.h index 25fe6af477..7eed21601b 100644 --- a/security/oc_pki_internal.h +++ b/security/oc_pki_internal.h @@ -19,9 +19,10 @@ #ifndef OC_PKI_INTERNAL_H #define OC_PKI_INTERNAL_H +#include "mbedtls/ecp.h" +#include "mbedtls/pk.h" + #include -#include -#include #ifdef __cplusplus extern "C" { diff --git a/security/oc_roles.c b/security/oc_roles.c index bf5a790aeb..b941d11f8f 100644 --- a/security/oc_roles.c +++ b/security/oc_roles.c @@ -28,7 +28,7 @@ #include "security/oc_roles_internal.h" #include "security/oc_tls_internal.h" -#include +#include "mbedtls/x509_crt.h" #include #include diff --git a/security/oc_security.c b/security/oc_security.c index cfca32b336..43d416dc97 100644 --- a/security/oc_security.c +++ b/security/oc_security.c @@ -38,11 +38,11 @@ #include "api/plgd/plgd_time_internal.h" #endif /* OC_HAS_FEATURE_PLGD_TIME */ -#include -#include -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/debug.h" +#include "mbedtls/memory_buffer_alloc.h" +#include "mbedtls/platform.h" +#include "mbedtls/platform_time.h" #ifndef OC_DYNAMIC_ALLOCATION @@ -61,7 +61,7 @@ static unsigned char g_alloc_buf[OC_MBEDTLS_ALLOCATION_BUFFER_SIZE]; #endif /* !OC_DYNAMIC_ALLOCATION */ #if defined(_WIN32) || defined(_WIN64) -#include +#include "mbedtls/platform.h" #endif /* _WIN32 || _WIN64 */ #include diff --git a/security/oc_security_internal.h b/security/oc_security_internal.h index d4027a295d..3546784494 100644 --- a/security/oc_security_internal.h +++ b/security/oc_security_internal.h @@ -22,7 +22,7 @@ #include "util/oc_features.h" #ifdef OC_HAS_FEATURE_PLGD_TIME -#include +#include "mbedtls/platform_time.h" #endif /* OC_HAS_FEATURE_PLGD_TIME */ #ifdef __cplusplus diff --git a/security/oc_tls.c b/security/oc_tls.c index 237b8edf71..cdd6b58399 100644 --- a/security/oc_tls.c +++ b/security/oc_tls.c @@ -59,15 +59,15 @@ #include "security/oc_oscore_internal.h" #endif /* OC_OSCORE */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" +#include "mbedtls/md.h" +#include "mbedtls/oid.h" +#include "mbedtls/pkcs5.h" +#include "mbedtls/ssl.h" +#include "mbedtls/ssl_cookie.h" +#include "mbedtls/timing.h" #include #include @@ -75,9 +75,9 @@ #include #if OC_ERR_IS_ENABLED -#include -#include -#include +#include "mbedtls/debug.h" +#include "mbedtls/error.h" +#include "mbedtls/platform.h" #endif /* OC_ERR_IS_ENABLED */ #define OC_TLS_SELECTED_ANY_CRED_ID (-1) diff --git a/security/oc_tls_internal.h b/security/oc_tls_internal.h index 592f68c554..2edc784fd3 100644 --- a/security/oc_tls_internal.h +++ b/security/oc_tls_internal.h @@ -27,9 +27,10 @@ #include "util/oc_list.h" #include "util/oc_process.h" -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/ssl.h" + #include #include #include diff --git a/security/unittest/acetest.cpp b/security/unittest/acetest.cpp index 60c966f5b4..e10fd47412 100644 --- a/security/unittest/acetest.cpp +++ b/security/unittest/acetest.cpp @@ -28,8 +28,9 @@ #include "tests/gtest/RepPool.h" #include "util/oc_list.h" +#include "gtest/gtest.h" + #include -#include #include #include #include diff --git a/security/unittest/acltest.cpp b/security/unittest/acltest.cpp index df8aca2425..97247539cd 100644 --- a/security/unittest/acltest.cpp +++ b/security/unittest/acltest.cpp @@ -63,8 +63,9 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include -#include #include #include diff --git a/security/unittest/certsgeneratetest.cpp b/security/unittest/certsgeneratetest.cpp index d28df34dec..55e3c5331a 100644 --- a/security/unittest/certsgeneratetest.cpp +++ b/security/unittest/certsgeneratetest.cpp @@ -29,12 +29,13 @@ #include "tests/gtest/Role.h" #include "tests/gtest/Utility.h" +#include "gtest/gtest.h" +#include "mbedtls/ctr_drbg.h" + #include #include #include -#include #include -#include #include #include diff --git a/security/unittest/certstest.cpp b/security/unittest/certstest.cpp index 3c32048191..f646d964e0 100644 --- a/security/unittest/certstest.cpp +++ b/security/unittest/certstest.cpp @@ -25,12 +25,13 @@ #include "security/oc_certs_internal.h" #include "tests/gtest/Utility.h" +#include "gtest/gtest.h" +#include "mbedtls/asn1.h" +#include "mbedtls/ctr_drbg.h" + #include #include -#include #include -#include -#include #include #include diff --git a/security/unittest/credtest.cpp b/security/unittest/credtest.cpp index 3da7da2b36..e42425b5b5 100644 --- a/security/unittest/credtest.cpp +++ b/security/unittest/credtest.cpp @@ -41,11 +41,12 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" +#include "mbedtls/build_info.h" +#include "mbedtls/md.h" + #include #include -#include -#include -#include #include static constexpr size_t kDeviceID{ 0 }; diff --git a/security/unittest/credutiltest.cpp b/security/unittest/credutiltest.cpp index dc5285ff37..b7b704f394 100644 --- a/security/unittest/credutiltest.cpp +++ b/security/unittest/credutiltest.cpp @@ -27,8 +27,9 @@ #include "util/oc_macros_internal.h" #include "util/oc_mmem_internal.h" +#include "gtest/gtest.h" + #include -#include #include #include #include diff --git a/security/unittest/csrtest.cpp b/security/unittest/csrtest.cpp index 9a92c1dfbe..81073897ee 100644 --- a/security/unittest/csrtest.cpp +++ b/security/unittest/csrtest.cpp @@ -30,10 +30,11 @@ #include "tests/gtest/KeyPair.h" #include "tests/gtest/Resource.h" +#include "gtest/gtest.h" +#include "mbedtls/x509_crt.h" + #include #include -#include -#include using namespace std::chrono_literals; diff --git a/security/unittest/doxmtest.cpp b/security/unittest/doxmtest.cpp index 61faecaf04..3123c558cd 100644 --- a/security/unittest/doxmtest.cpp +++ b/security/unittest/doxmtest.cpp @@ -35,10 +35,11 @@ #include "tests/gtest/Resource.h" #include "tests/gtest/Storage.h" +#include "gtest/gtest.h" + #include #include #include -#include #include using namespace std::chrono_literals; diff --git a/security/unittest/dtlstest.cpp b/security/unittest/dtlstest.cpp index 026dc84d8c..d375b63597 100644 --- a/security/unittest/dtlstest.cpp +++ b/security/unittest/dtlstest.cpp @@ -29,8 +29,9 @@ #include "tests/gtest/tls/DTLSClient.h" #include "util/oc_macros_internal.h" +#include "gtest/gtest.h" + #include -#include // TODO: upgrade mingw, because on v10.2 std::thread doesn't work correctly #if defined(__MINGW32__) && defined(__GNUC__) && (__GNUC__ < 12) @@ -40,6 +41,8 @@ #include #endif /* __MINGW32__ */ +#include "mbedtls/build_info.h" + #if defined(MBEDTLS_NET_C) && defined(MBEDTLS_TIMING_C) static constexpr size_t kDeviceID{ 0 }; diff --git a/security/unittest/keypairtest.cpp b/security/unittest/keypairtest.cpp index 362f71c4f9..f70b5f6f7e 100644 --- a/security/unittest/keypairtest.cpp +++ b/security/unittest/keypairtest.cpp @@ -29,9 +29,10 @@ #include "tests/gtest/PKI.h" #include "tests/gtest/RepPool.h" +#include "gtest/gtest.h" +#include "mbedtls/ecp.h" + #include -#include -#include #include #include diff --git a/security/unittest/obt_certstest.cpp b/security/unittest/obt_certstest.cpp index e5d3630405..b1b3e60b81 100644 --- a/security/unittest/obt_certstest.cpp +++ b/security/unittest/obt_certstest.cpp @@ -31,11 +31,12 @@ #include "tests/gtest/PKI.h" #include "tests/gtest/Role.h" +#include "gtest/gtest.h" +#include "mbedtls/x509.h" + #include #include -#include -#include -#include +#include #include #include diff --git a/security/unittest/oscore_hkdf_test.cpp b/security/unittest/oscore_hkdf_test.cpp index 8c28890266..b081bd9310 100644 --- a/security/unittest/oscore_hkdf_test.cpp +++ b/security/unittest/oscore_hkdf_test.cpp @@ -23,9 +23,10 @@ #include "security/oc_oscore_crypto_internal.h" #include "security/oc_tls_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include class TestOSCOREHKDF : public testing::Test { diff --git a/security/unittest/oscore_test.cpp b/security/unittest/oscore_test.cpp index 584a64b19e..7b5c20acfb 100644 --- a/security/unittest/oscore_test.cpp +++ b/security/unittest/oscore_test.cpp @@ -30,9 +30,10 @@ #include "security/oc_oscore_context_internal.h" #include "security/oc_oscore_crypto_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include class TestOSCORE : public testing::Test { diff --git a/security/unittest/pkitest.cpp b/security/unittest/pkitest.cpp index 14dcfa20c3..c48236a120 100644 --- a/security/unittest/pkitest.cpp +++ b/security/unittest/pkitest.cpp @@ -38,9 +38,9 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ -#include +#include "gtest/gtest.h" +#include "mbedtls/build_info.h" -#include #include #include diff --git a/security/unittest/pstattest.cpp b/security/unittest/pstattest.cpp index 317c435605..27ad25ed60 100644 --- a/security/unittest/pstattest.cpp +++ b/security/unittest/pstattest.cpp @@ -42,8 +42,9 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include -#include #include static const std::string kDeviceURI{ "/oic/d" }; diff --git a/security/unittest/rolestest.cpp b/security/unittest/rolestest.cpp index bfbe8210d8..5423162e64 100644 --- a/security/unittest/rolestest.cpp +++ b/security/unittest/rolestest.cpp @@ -43,10 +43,11 @@ #include "util/oc_macros_internal.h" #include "util/oc_secure_string_internal.h" +#include "gtest/gtest.h" + #include #include #include -#include #include using namespace std::chrono_literals; diff --git a/security/unittest/sditest.cpp b/security/unittest/sditest.cpp index a70189fd1e..0a6b765269 100644 --- a/security/unittest/sditest.cpp +++ b/security/unittest/sditest.cpp @@ -36,9 +36,10 @@ #include "util/oc_features.h" #include "util/oc_macros_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include using namespace std::chrono_literals; diff --git a/security/unittest/sptest.cpp b/security/unittest/sptest.cpp index e006c9b8e3..63920a3f62 100644 --- a/security/unittest/sptest.cpp +++ b/security/unittest/sptest.cpp @@ -44,9 +44,10 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include #include -#include #include using namespace std::chrono_literals; diff --git a/security/unittest/tls_cert_test.cpp b/security/unittest/tls_cert_test.cpp index da37452ec7..45d812fb69 100644 --- a/security/unittest/tls_cert_test.cpp +++ b/security/unittest/tls_cert_test.cpp @@ -41,11 +41,12 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include #include #include #include -#include #include #include #include diff --git a/security/unittest/tls_peer_test.cpp b/security/unittest/tls_peer_test.cpp index 3635280e9d..84cfe15b28 100644 --- a/security/unittest/tls_peer_test.cpp +++ b/security/unittest/tls_peer_test.cpp @@ -40,17 +40,18 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ -#ifdef _WIN32 -#include -#endif /* _WIN32 */ +#include "gtest/gtest.h" +#include "mbedtls/build_info.h" +#include "mbedtls/x509_crt.h" #include -#include -#include -#include #include #include +#ifdef _WIN32 +#include +#endif /* _WIN32 */ + static constexpr size_t kDeviceID{ 0 }; static const std::string kDeviceURI{ "/oic/d" }; static const std::string kDeviceType{ "oic.d.light" }; diff --git a/security/unittest/tlstest.cpp b/security/unittest/tlstest.cpp index bd07c55a65..a89feacb48 100644 --- a/security/unittest/tlstest.cpp +++ b/security/unittest/tlstest.cpp @@ -38,9 +38,10 @@ #include "api/oc_push_internal.h" #endif /* OC_HAS_FEATURE_PUSH */ +#include "gtest/gtest.h" + #include #include -#include class TestTLS : public testing::Test {}; diff --git a/tests/gtest/Device.cpp b/tests/gtest/Device.cpp index a1b8ff58cf..68cbaf0e9d 100644 --- a/tests/gtest/Device.cpp +++ b/tests/gtest/Device.cpp @@ -33,9 +33,10 @@ #include "plgd/plgd_time.h" #endif /* OC_HAS_FEATURE_PLGD_TIME */ +#include "gtest/gtest.h" + #include #include -#include #include #include diff --git a/tests/gtest/Endpoint.cpp b/tests/gtest/Endpoint.cpp index eae276db60..c4e91af455 100644 --- a/tests/gtest/Endpoint.cpp +++ b/tests/gtest/Endpoint.cpp @@ -21,8 +21,9 @@ #include "api/oc_endpoint_internal.h" #include "oc_helpers.h" +#include "gtest/gtest.h" + #include -#include namespace oc::endpoint { diff --git a/tests/gtest/KeyPair.cpp b/tests/gtest/KeyPair.cpp index 55bd65cb0d..5b1cb16509 100644 --- a/tests/gtest/KeyPair.cpp +++ b/tests/gtest/KeyPair.cpp @@ -20,8 +20,9 @@ #if defined(OC_SECURITY) && defined(OC_PKI) +#include "gtest/gtest.h" + #include -#include namespace oc { diff --git a/tests/gtest/PKI.cpp b/tests/gtest/PKI.cpp index c5e5fa2e75..ae1e9ddde0 100644 --- a/tests/gtest/PKI.cpp +++ b/tests/gtest/PKI.cpp @@ -29,10 +29,11 @@ #include "security/oc_obt_internal.h" #endif /* OC_DYNAMIC_ALLOCATION */ +#include "gtest/gtest.h" + #include #include #include -#include #include #include diff --git a/tests/gtest/PKI.h b/tests/gtest/PKI.h index 12d1591759..68bd374550 100644 --- a/tests/gtest/PKI.h +++ b/tests/gtest/PKI.h @@ -25,9 +25,9 @@ #include "tests/gtest/KeyPair.h" #include "tests/gtest/Role.h" -#include -#include -#include +#include "mbedtls/build_info.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" #include #include diff --git a/tests/gtest/RepPool.cpp b/tests/gtest/RepPool.cpp index c713f4e216..d58960150e 100644 --- a/tests/gtest/RepPool.cpp +++ b/tests/gtest/RepPool.cpp @@ -19,7 +19,7 @@ #include "api/oc_rep_internal.h" #include "RepPool.h" -#include +#include "gtest/gtest.h" namespace oc { diff --git a/tests/gtest/Resource.cpp b/tests/gtest/Resource.cpp index 595f70a3f3..9a24258574 100644 --- a/tests/gtest/Resource.cpp +++ b/tests/gtest/Resource.cpp @@ -28,10 +28,11 @@ #include "api/oc_collection_internal.h" #endif /* OC_COLLECTIONS */ +#include "gtest/gtest.h" + #include #include #include -#include namespace oc { diff --git a/tests/gtest/Storage.cpp b/tests/gtest/Storage.cpp index b34f294016..8f11e37944 100644 --- a/tests/gtest/Storage.cpp +++ b/tests/gtest/Storage.cpp @@ -24,8 +24,9 @@ #include "port/oc_storage.h" #include "port/oc_storage_internal.h" +#include "gtest/gtest.h" + #include -#include namespace oc { diff --git a/tests/gtest/tls/DTLSClient.cpp b/tests/gtest/tls/DTLSClient.cpp index 624c3b4a73..89bb14b996 100644 --- a/tests/gtest/tls/DTLSClient.cpp +++ b/tests/gtest/tls/DTLSClient.cpp @@ -20,7 +20,7 @@ #ifdef OC_SECURITY -#include +#include "mbedtls/build_info.h" #if defined(MBEDTLS_NET_C) && defined(MBEDTLS_TIMING_C) @@ -29,15 +29,15 @@ #include "port/oc_log_internal.h" #include "security/oc_entropy_internal.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/debug.h" +#include "mbedtls/entropy.h" +#include "mbedtls/error.h" +#include "mbedtls/net_sockets.h" +#include "mbedtls/platform.h" +#include "mbedtls/ssl.h" +#include "mbedtls/ssl_cookie.h" +#include "mbedtls/timing.h" namespace oc::tls { diff --git a/tests/gtest/tls/DTLSClient.h b/tests/gtest/tls/DTLSClient.h index 4ffa465da1..dae0b0d55b 100644 --- a/tests/gtest/tls/DTLSClient.h +++ b/tests/gtest/tls/DTLSClient.h @@ -22,21 +22,22 @@ #ifdef OC_SECURITY -#include +#include "mbedtls/build_info.h" #if defined(MBEDTLS_NET_C) && defined(MBEDTLS_TIMING_C) #include "DTLS.h" #include "Service.h" +#include "mbedtls/build_info.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/entropy.h" +#include "mbedtls/net_sockets.h" +#include "mbedtls/ssl.h" +#include "mbedtls/ssl_cookie.h" +#include "mbedtls/timing.h" + #include -#include -#include -#include -#include -#include -#include -#include #include #include diff --git a/tests/gtest/tls/Service.cpp b/tests/gtest/tls/Service.cpp index 1bffcde4c5..00fae735c7 100644 --- a/tests/gtest/tls/Service.cpp +++ b/tests/gtest/tls/Service.cpp @@ -20,7 +20,7 @@ #ifdef OC_SECURITY -#include +#include "mbedtls/build_info.h" #if defined(MBEDTLS_NET_C) && defined(MBEDTLS_TIMING_C) diff --git a/tests/gtest/tls/Service.h b/tests/gtest/tls/Service.h index 5e518ac0e2..cc90702f28 100644 --- a/tests/gtest/tls/Service.h +++ b/tests/gtest/tls/Service.h @@ -22,16 +22,14 @@ #ifdef OC_SECURITY -#include +#include "mbedtls/build_info.h" #if defined(MBEDTLS_NET_C) && defined(MBEDTLS_TIMING_C) #include "port/oc_connectivity.h" -#include - -#include -#include +#include "mbedtls/net_sockets.h" +#include "mbedtls/ssl.h" #include #include diff --git a/tests/itc/ri/include/RIHelper.h b/tests/itc/ri/include/RIHelper.h index 51e0c7f810..cbcc4efa42 100644 --- a/tests/itc/ri/include/RIHelper.h +++ b/tests/itc/ri/include/RIHelper.h @@ -23,7 +23,8 @@ #include "oc_uuid.h" #include "port/oc_clock.h" -#include +#include "gtest/gtest.h" + #include #include #include diff --git a/tests/itc/ri/src/RIGeneralIntegrationTest.cpp b/tests/itc/ri/src/RIGeneralIntegrationTest.cpp index 91c5ecf016..9bc4557d84 100644 --- a/tests/itc/ri/src/RIGeneralIntegrationTest.cpp +++ b/tests/itc/ri/src/RIGeneralIntegrationTest.cpp @@ -18,7 +18,7 @@ #include "RIHelper.h" -#include +#include "gtest/gtest.h" class RIGeneralIntegrationTest : public ::testing::Test {}; diff --git a/tests/libfaketime/unittest/clocktest.cpp b/tests/libfaketime/unittest/clocktest.cpp index 9e00322331..b0ba93cc30 100644 --- a/tests/libfaketime/unittest/clocktest.cpp +++ b/tests/libfaketime/unittest/clocktest.cpp @@ -21,8 +21,9 @@ #include "port/oc_clock.h" #include "port/oc_log_internal.h" +#include "gtest/gtest.h" + #include -#include class TestClock : public testing::Test { public: diff --git a/tests/libfaketime/unittest/dtlstest.cpp b/tests/libfaketime/unittest/dtlstest.cpp index e09f512ecd..96d9c62d26 100644 --- a/tests/libfaketime/unittest/dtlstest.cpp +++ b/tests/libfaketime/unittest/dtlstest.cpp @@ -29,9 +29,10 @@ #include "tests/gtest/tls/DTLS.h" #include "tests/gtest/tls/DTLSClient.h" +#include "gtest/gtest.h" + #include #include -#include // TODO: upgrade mingw, because on v10.2 std::thread doesn't work correctly #if defined(__MINGW32__) && defined(__GNUC__) && (__GNUC__ < 12) diff --git a/tests/libfaketime/unittest/etimertest.cpp b/tests/libfaketime/unittest/etimertest.cpp index f3b512d795..7eb518a1fb 100644 --- a/tests/libfaketime/unittest/etimertest.cpp +++ b/tests/libfaketime/unittest/etimertest.cpp @@ -24,9 +24,10 @@ #include "util/oc_etimer_internal.h" #include "util/oc_process_internal.h" +#include "gtest/gtest.h" + #include #include -#include OC_PROCESS(oc_test_process, "Testing process"); diff --git a/util/unittest/crc64test.cpp b/util/unittest/crc64test.cpp index 872724b0f8..a99f312f9e 100644 --- a/util/unittest/crc64test.cpp +++ b/util/unittest/crc64test.cpp @@ -22,7 +22,7 @@ #include "util/oc_crc_internal.h" -#include +#include "gtest/gtest.h" TEST(TestCRC, CRC64) { diff --git a/util/unittest/endpoint_address_test.cpp b/util/unittest/endpoint_address_test.cpp index a17c2fc9da..def7a6c30d 100644 --- a/util/unittest/endpoint_address_test.cpp +++ b/util/unittest/endpoint_address_test.cpp @@ -31,7 +31,7 @@ #include "util/oc_mmem_internal.h" #include -#include +#include "gtest/gtest.h" #include static constexpr size_t OC_MAX_ENDPOINT_ADDRESSES = 3; diff --git a/util/unittest/etimertest.cpp b/util/unittest/etimertest.cpp index b10d4076c7..6f9d7977b7 100644 --- a/util/unittest/etimertest.cpp +++ b/util/unittest/etimertest.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include "gtest/gtest.h" #include #include #include diff --git a/util/unittest/jsmntest.cpp b/util/unittest/jsmntest.cpp index a3c3aa05ec..b35fb6abd7 100644 --- a/util/unittest/jsmntest.cpp +++ b/util/unittest/jsmntest.cpp @@ -22,9 +22,10 @@ #include "util/jsmn/jsmn_internal.h" +#include "gtest/gtest.h" + #include #include -#include #include TEST(TestJsmn, ParseEmpty) diff --git a/util/unittest/listtest.cpp b/util/unittest/listtest.cpp index 9cab93cd1c..15b77e67a9 100644 --- a/util/unittest/listtest.cpp +++ b/util/unittest/listtest.cpp @@ -18,7 +18,8 @@ #include "util/oc_list.h" -#include +#include "gtest/gtest.h" + #include #include diff --git a/util/unittest/memblocktest.cpp b/util/unittest/memblocktest.cpp index 3ea54c20af..754c98c0a4 100644 --- a/util/unittest/memblocktest.cpp +++ b/util/unittest/memblocktest.cpp @@ -18,8 +18,9 @@ #include "util/oc_memb.h" +#include "gtest/gtest.h" + #include -#include struct test_data_t { diff --git a/util/unittest/memmtest.cpp b/util/unittest/memmtest.cpp index 3596c1e6c1..9a6a0c30f8 100644 --- a/util/unittest/memmtest.cpp +++ b/util/unittest/memmtest.cpp @@ -18,8 +18,9 @@ #include +#include "gtest/gtest.h" + #include -#include class TestMemoryPool : public testing::Test { public: diff --git a/util/unittest/numerictest.cpp b/util/unittest/numerictest.cpp index 97e2d55a0f..3ba4262f3d 100644 --- a/util/unittest/numerictest.cpp +++ b/util/unittest/numerictest.cpp @@ -18,8 +18,9 @@ #include "util/oc_numeric_internal.h" +#include "gtest/gtest.h" + #include -#include #include TEST(TestNumeric, DoubleIsZero) diff --git a/util/unittest/processtest.cpp b/util/unittest/processtest.cpp index 088f2fdd03..521ca25842 100644 --- a/util/unittest/processtest.cpp +++ b/util/unittest/processtest.cpp @@ -27,8 +27,9 @@ #include "security/oc_pstat_internal.h" #endif /* OC_SECURITY */ +#include "gtest/gtest.h" + #include -#include using namespace std::chrono_literals; diff --git a/util/unittest/securestringtest.cpp b/util/unittest/securestringtest.cpp index 22a63144ef..3065ede2d0 100644 --- a/util/unittest/securestringtest.cpp +++ b/util/unittest/securestringtest.cpp @@ -18,7 +18,8 @@ #include "util/oc_secure_string_internal.h" -#include +#include "gtest/gtest.h" + #include #include diff --git a/util/unittest/timertest.cpp b/util/unittest/timertest.cpp index 4a8ed49aae..967b9f2d9b 100644 --- a/util/unittest/timertest.cpp +++ b/util/unittest/timertest.cpp @@ -22,7 +22,8 @@ #include "tests/gtest/Clock.h" -#include +#include "gtest/gtest.h" + #include using namespace std::chrono_literals;