From 7a31ca5dd37fd20280f9be619c4b28c184f6bdc7 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Wed, 23 Jun 2021 23:50:07 +0000 Subject: [PATCH] Fix Main - ignore warning 6101 (#2471) * Ignoring msvc warning 6101 * remove not required * not required * perf issues * fix livetests build args --- .../templates/jobs/archetype-sdk-tests.yml | 1 + sdk/core/azure-core/CMakeLists.txt | 5 ++--- sdk/core/perf/test/CMakeLists.txt | 6 ++++++ sdk/core/perf/test/src/random_stream_test.cpp | 13 +++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml index f66da94e7..8e910a536 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml @@ -127,6 +127,7 @@ jobs: - template: /eng/pipelines/templates/steps/cmake-build.yml parameters: GenerateArgs: $(CmakeArgs) + BuildArgs: "$(BuildArgs)" - template: /eng/common/TestResources/deploy-test-resources.yml parameters: diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index d1887f760..49cd81fed 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -152,9 +152,8 @@ endif() if (MSVC) # Disable warnings: - # - C6285: ( || ) -> VBProject static analysis on Functional header: - # _Is_large, regression from VS version 19.28.29915.0 to 19.29.30037.0 - target_compile_options(azure-core PUBLIC /wd6285) + # - C6101: Returning uninitialized memory '*Mtu' -> libcurl calling WSAGetIPUserMtu from WS2tcpip.h + target_compile_options(azure-core PUBLIC /wd6101) endif() get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp") diff --git a/sdk/core/perf/test/CMakeLists.txt b/sdk/core/perf/test/CMakeLists.txt index 11ef47f80..186c0517d 100644 --- a/sdk/core/perf/test/CMakeLists.txt +++ b/sdk/core/perf/test/CMakeLists.txt @@ -49,6 +49,12 @@ add_executable ( src/random_stream_test.cpp ) +if (MSVC) + # Disable warnings + # - C6326: Google comparisons + target_compile_options(azure-perf-unit-test PUBLIC /wd6326) +endif() + target_link_libraries(azure-perf-unit-test PRIVATE azure-perf gtest gtest_main) gtest_discover_tests(azure-perf-unit-test diff --git a/sdk/core/perf/test/src/random_stream_test.cpp b/sdk/core/perf/test/src/random_stream_test.cpp index 1ce170c8c..ea495f36d 100644 --- a/sdk/core/perf/test/src/random_stream_test.cpp +++ b/sdk/core/perf/test/src/random_stream_test.cpp @@ -4,21 +4,22 @@ #include #include +#include TEST(circular_stream, basic) { size_t const totalSize = 1024 * 1024 * 3; // should give 5 loops size_t const chunk = 1024 * 1024; auto r_stream = Azure::Perf::RandomStream::Create(totalSize); - uint8_t buffer[chunk]; - uint8_t buffer2[chunk]; + std::vector buffer(chunk); + std::vector buffer2(chunk); // 1st read - auto count = r_stream->Read(buffer, chunk, Azure::Core::Context::ApplicationContext); + auto count = r_stream->Read(buffer.data(), chunk, Azure::Core::Context::ApplicationContext); EXPECT_EQ(count, chunk); // 2nd read - count = r_stream->Read(buffer2, chunk, Azure::Core::Context::ApplicationContext); + count = r_stream->Read(buffer2.data(), chunk, Azure::Core::Context::ApplicationContext); EXPECT_EQ(count, chunk); for (size_t i = 0; i != chunk; i++) { @@ -26,7 +27,7 @@ TEST(circular_stream, basic) } // 3nd read - count = r_stream->Read(buffer, chunk, Azure::Core::Context::ApplicationContext); + count = r_stream->Read(buffer.data(), chunk, Azure::Core::Context::ApplicationContext); EXPECT_EQ(count, chunk); for (size_t i = 0; i != chunk; i++) { @@ -34,7 +35,7 @@ TEST(circular_stream, basic) } // 4nd read - count = r_stream->Read(buffer, chunk, Azure::Core::Context::ApplicationContext); + count = r_stream->Read(buffer.data(), chunk, Azure::Core::Context::ApplicationContext); EXPECT_EQ(count, 0U); // should not change buffer for (size_t i = 0; i != chunk; i++)