From 16a64ab3e9cc3aa090bbfda399f04fdbb3e7dc6f Mon Sep 17 00:00:00 2001 From: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Date: Thu, 1 Jun 2023 17:52:44 -0700 Subject: [PATCH] Fix live tests CI compilation (unused variable warning - gets treated as error) (#4685) * Fix live tests CI compilation (unused variable warning - gets treated as error) * A warning popped up in opentelemetry due to header reordering --------- Co-authored-by: Anton Kolesnyk --- .../test/ut/claim_based_security_tests.cpp | 4 ++-- .../test/ut/test_exporter.hpp | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core-amqp/test/ut/claim_based_security_tests.cpp b/sdk/core/azure-core-amqp/test/ut/claim_based_security_tests.cpp index e101ae466..8a5484bf3 100644 --- a/sdk/core/azure-core-amqp/test/ut/claim_based_security_tests.cpp +++ b/sdk/core/azure-core-amqp/test/ut/claim_based_security_tests.cpp @@ -79,8 +79,8 @@ TEST_F(TestCbs, CbsOpen) { ClaimsBasedSecurity cbs(session); cbs.SetTrace(true); - CbsOpenResult openResult; - EXPECT_EQ(CbsOpenResult::Ok, openResult = cbs.Open()); + CbsOpenResult openResult = cbs.Open(); + EXPECT_EQ(CbsOpenResult::Ok, openResult); GTEST_LOG_(INFO) << "Open Completed."; if (openResult == CbsOpenResult::Ok) { diff --git a/sdk/core/azure-core-tracing-opentelemetry/test/ut/test_exporter.hpp b/sdk/core/azure-core-tracing-opentelemetry/test/ut/test_exporter.hpp index b446ca351..4964cc983 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/test/ut/test_exporter.hpp +++ b/sdk/core/azure-core-tracing-opentelemetry/test/ut/test_exporter.hpp @@ -5,8 +5,17 @@ #include +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 6323) // Disable "Use of arithmetic operator on Boolean type" warning. +#endif + #include +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + class RecordedSpan : public opentelemetry::sdk::trace::Recordable { public: struct Attribute