Fix Main - ignore warning 6101 (#2471)
* Ignoring msvc warning 6101 * remove not required * not required * perf issues * fix livetests build args
This commit is contained in:
parent
f052feffa1
commit
7a31ca5dd3
@ -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:
|
||||
|
||||
@ -152,9 +152,8 @@ endif()
|
||||
|
||||
if (MSVC)
|
||||
# Disable warnings:
|
||||
# - C6285: (<non-zero constant> || <non-zero constant>) -> 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")
|
||||
|
||||
@ -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
|
||||
|
||||
@ -4,21 +4,22 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <azure/perf/random_stream.hpp>
|
||||
#include <vector>
|
||||
|
||||
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<uint8_t> buffer(chunk);
|
||||
std::vector<uint8_t> 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++)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user