diff --git a/CMakePresets.json b/CMakePresets.json index ec1f668ea..0ebc0ba62 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,5 +1,5 @@ { - "version": 2, + "version": 3, "cmakeMinimumRequired": { "major": 3, "minor": 13, @@ -20,6 +20,11 @@ "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" } }, { @@ -298,6 +303,40 @@ "BUILD_PERFORMANCE_TESTS": true, "BUILD_SAMPLES": true } + }, + + { + "name": "linux-basic-gcc9", + "displayName": "Linux GCC 9 ", + "description": "Using compilers: C = /usr/bin/gcc-9, CXX = /usr/bin/g++-9", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}", + "CMAKE_C_COMPILER": "/usr/bin/gcc-9", + "CMAKE_CXX_COMPILER": "/usr/bin/g++-9" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "linux-gcc9-debug", + "displayName": "Linux GCC 9 Debug", + "inherits": "linux-basic-gcc9", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux-gcc9-debug-tests", + "inherits": "linux-gcc9-debug", + "displayName": "Linux GCC 9 Debug+Tests", + "cacheVariables": { + "BUILD_TESTING": "true" + } } ] } diff --git a/sdk/core/azure-core-amqp/inc/azure/core/amqp/models/amqp_message.hpp b/sdk/core/azure-core-amqp/inc/azure/core/amqp/models/amqp_message.hpp index c0fb8ace7..d115f1101 100644 --- a/sdk/core/azure-core-amqp/inc/azure/core/amqp/models/amqp_message.hpp +++ b/sdk/core/azure-core-amqp/inc/azure/core/amqp/models/amqp_message.hpp @@ -20,6 +20,9 @@ template <> struct Azure::Core::_internal::UniqueHandleHelper; }; +namespace Azure { namespace Core { namespace Amqp { namespace Models { namespace _internal { + class AmqpMessageFactory; +}}}}} // namespace Azure::Core::Amqp::Models::_internal namespace Azure { namespace Core { namespace Amqp { namespace Models { /** @@ -36,10 +39,6 @@ namespace Azure { namespace Core { namespace Amqp { namespace Models { }; using UniqueMessageHandle = Azure::Core::_internal::UniqueHandle; - namespace _internal { - class AmqpMessageFactory; - } - constexpr int AmqpMessageFormatValue = 0; // Specifies the message format for an AMQP message. class AmqpMessage final { @@ -50,17 +49,21 @@ namespace Azure { namespace Core { namespace Amqp { namespace Models { /** @brief Destroy an instance of an AMQP Message object. */ ~AmqpMessage() = default; + /** @brief Create a new AMQP Message from an existing message moving the contents. */ + AmqpMessage(AmqpMessage&&) = default; + /** @brief Construct a new AMQP message object from an existing object. */ AmqpMessage(AmqpMessage const&) = default; - /** @brief Copy an AMQP message object to another object. @returns A reference to this.*/ + /** @brief Copy an AMQP message object to another object. + * @returns A reference to this. + */ AmqpMessage& operator=(AmqpMessage const&) = default; - /** @brief Create a new AMQP Message from an existing message moving the contents. */ - AmqpMessage(AmqpMessage&&) noexcept = default; - - /** @brief Move an AMQP message object to another object. @returns A reference to this.*/ - AmqpMessage& operator=(AmqpMessage&&) noexcept = default; + /** @brief Move an AMQP message object to another object. + * @returns A reference to this. + */ + AmqpMessage& operator=(AmqpMessage&&) = default; bool operator==(AmqpMessage const& other) const noexcept; bool operator!=(AmqpMessage const& other) const noexcept { return !(*this == other); } diff --git a/sdk/core/azure-core-amqp/src/models/amqp_message.cpp b/sdk/core/azure-core-amqp/src/models/amqp_message.cpp index 3840bb435..862b19b74 100644 --- a/sdk/core/azure-core-amqp/src/models/amqp_message.cpp +++ b/sdk/core/azure-core-amqp/src/models/amqp_message.cpp @@ -61,7 +61,7 @@ namespace Azure { namespace Core { namespace Amqp { namespace Models { { if (message == nullptr) { - return AmqpMessage(nullptr); + return nullptr; } AmqpMessage rv; rv.Header = _internal::MessageHeaderFactory::FromUamqp(GetHeaderFromMessage(message)); diff --git a/sdk/core/azure-core-amqp/test/ut/CMakeLists.txt b/sdk/core/azure-core-amqp/test/ut/CMakeLists.txt index c1535e648..e7ab6ae55 100644 --- a/sdk/core/azure-core-amqp/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core-amqp/test/ut/CMakeLists.txt @@ -31,6 +31,22 @@ add_executable(azure-core-amqp-tests ) add_dependencies(azure-core-amqp-tests azure-core-amqp) +if (MSVC) + # Disable warnings: + # - C26495: Variable + # - 'testing::internal::Mutex::critical_section_' + # - 'testing::internal::Mutex::critical_section_init_phase_' + # - 'testing::internal::Mutex::owner_thread_id_' + # - 'testing::internal::Mutex::type_' + # is uninitialized. Always initialize member variables (type.6). + # - C26812: The enum type + # - 'testing::internal::Mutex::StaticConstructorSelector' + # - 'testing::TestPartResult::Type' + # is unscoped. Prefer 'enum class' over 'enum' (Enum.3) + # - C6326: Google comparisons + target_compile_options(azure-core-amqp-tests PUBLIC /wd26495 /wd26812 /wd6326 /wd28204 /wd28020 /wd6330 /wd4389) +endif() + target_include_directories(azure-core-amqp-tests PRIVATE ${azure-core-amqp_SOURCE_DIR}) # Link test executable against gtest & gtest_main