diff --git a/Code/Framework/AzCore/Tests/AZStd/Algorithms.cpp b/Code/Framework/AzCore/Tests/AZStd/Algorithms.cpp index 2bb799e627..a1c9e5d79e 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Algorithms.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Algorithms.cpp @@ -1032,7 +1032,7 @@ namespace UnitTest auto CreateArray = []() constexpr -> AZStd::array { AZStd::array localArray = { {1, 2, 3} }; - auto resultFunc = AZStd::for_each(localArray.begin(), localArray.end(), [](int& element) { ++element; }); + AZStd::for_each(localArray.begin(), localArray.end(), [](int& element) { ++element; }); return localArray; }; constexpr AZStd::array testArray = CreateArray(); @@ -1271,7 +1271,6 @@ namespace UnitTest TEST_F(Algorithms, Unique_Compile_WhenUsedInConstexpr) { - constexpr AZStd::array testList = { { 1, 2, 3 } }; auto TestUnique = []() constexpr { AZStd::array localArray{ { 1, 2, 2, 5, 5, 6} }; diff --git a/Code/Framework/AzCore/Tests/AZStd/FunctorsBind.cpp b/Code/Framework/AzCore/Tests/AZStd/FunctorsBind.cpp index b720257f18..58ab71096b 100644 --- a/Code/Framework/AzCore/Tests/AZStd/FunctorsBind.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/FunctorsBind.cpp @@ -940,9 +940,10 @@ namespace UnitTest // 64 Byte buffer is used to prevent AZStd::function for storing the // lambda internal storage using the small buffer optimization // Therefore causing the supplied allocator to be used - AZStd::aligned_storage_t<64, 1> bufferToAvoidSmallBufferOptimization; + [[maybe_unused]] AZStd::aligned_storage_t<64, 1> bufferToAvoidSmallBufferOptimization; auto xValueAndConstXValueFunc = [bufferToAvoidSmallBufferOptimization](int lhs, int rhs) -> int { + AZ_UNUSED(bufferToAvoidSmallBufferOptimization); return lhs + rhs; }; diff --git a/Code/Framework/AzCore/Tests/AZStd/ListsIntrusive.cpp b/Code/Framework/AzCore/Tests/AZStd/ListsIntrusive.cpp index 511a4e479e..9e238b3d7d 100644 --- a/Code/Framework/AzCore/Tests/AZStd/ListsIntrusive.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/ListsIntrusive.cpp @@ -997,7 +997,7 @@ namespace UnitTest myclass_base_list.clear(); auto reverseIterBegin = myclass_base_list.rbegin(); auto reverseIterEnd = myclass_base_list.rend(); - EXPECT_EQ(reverseIterEnd, reverseIterEnd); + EXPECT_EQ(reverseIterBegin, reverseIterEnd); } } } diff --git a/Code/Framework/AzCore/Tests/AZStd/SetsIntrusive.cpp b/Code/Framework/AzCore/Tests/AZStd/SetsIntrusive.cpp index 61f9144452..6cae83c3ad 100644 --- a/Code/Framework/AzCore/Tests/AZStd/SetsIntrusive.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/SetsIntrusive.cpp @@ -287,7 +287,7 @@ namespace UnitTest myclass_base_set.clear(); auto reverseIterBegin = myclass_base_set.rbegin(); auto reverseIterEnd = myclass_base_set.rend(); - EXPECT_EQ(reverseIterEnd, reverseIterEnd); + EXPECT_EQ(reverseIterBegin, reverseIterEnd); } } } diff --git a/Code/Framework/AzCore/Tests/AZStd/String.cpp b/Code/Framework/AzCore/Tests/AZStd/String.cpp index 0ff12a352c..4c6687b00d 100644 --- a/Code/Framework/AzCore/Tests/AZStd/String.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/String.cpp @@ -1229,7 +1229,7 @@ namespace UnitTest string_view subView2 = view2.substr(10); EXPECT_EQ("Haystack", subView2); AZ_TEST_START_TRACE_SUPPRESSION; - string_view assertSubView = view2.substr(view2.size() + 1); + [[maybe_unused]] string_view assertSubView = view2.substr(view2.size() + 1); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // compare @@ -1472,7 +1472,7 @@ namespace UnitTest class WrappedInt { - int val; + [[maybe_unused]] int val; }; using ValidFormatArg = AZStd::string::_Format_Internal::ValidFormatArg; @@ -1751,6 +1751,7 @@ namespace UnitTest static constexpr basic_string_view elementView1(compileTimeString1); static constexpr basic_string_view elementView2(compileTimeString2); static_assert(elementView1.data(), "string_view.data() should be non-nullptr"); + static_assert(elementView2.data(), "string_view.data() should be non-nullptr"); } TYPED_TEST(BasicStringViewConstexprFixture, StringView_SizeOperatorsConstexpr) @@ -1779,7 +1780,7 @@ namespace UnitTest { using TypeParam = char; // null terminated compile time string - auto MakeCompileTimeString1 = []() constexpr -> const TypeParam* + [[maybe_unused]] auto MakeCompileTimeString1 = []() constexpr -> const TypeParam* { return "HelloWorld"; }; @@ -2131,7 +2132,6 @@ namespace UnitTest constexpr AZStd::fixed_string<128> test3{ AZStd::fixed_string<128>{}.insert(0, "Brown") }; constexpr AZStd::fixed_string<128> test4{ AZStd::fixed_string<128>{ "App" }.insert(0, AZStd::string_view("Blue")) }; constexpr AZStd::fixed_string<128> test5{ AZStd::fixed_string<128>{ "App" }.insert(0, test1, 2, 2) }; - constexpr AZStd::string_view redView("Red"); constexpr AZStd::fixed_string<128> test6{ AZStd::fixed_string<128>{ "App" }.insert(size_t(0), 5, 'X') }; constexpr AZStd::fixed_string<128> test7{ AZStd::fixed_string<128>{ "App" }.insert(0, "GreenTea", 5) }; auto MakeFixedStringWithInsertWithIteratorPos1 = []() constexpr diff --git a/Code/Framework/AzCore/Tests/Math/ShapeIntersectionTests.cpp b/Code/Framework/AzCore/Tests/Math/ShapeIntersectionTests.cpp index 659febf564..e7980af781 100644 --- a/Code/Framework/AzCore/Tests/Math/ShapeIntersectionTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/ShapeIntersectionTests.cpp @@ -117,9 +117,6 @@ namespace UnitTest EXPECT_TRUE(AZ::ShapeIntersection::Classify(frustum, s2) == AZ::IntersectResult::Exterior); } - AZ::Vector3 axisX = AZ::Vector3::CreateAxisX(); - AZ::Vector3 axisY = AZ::Vector3::CreateAxisY(); - AZ::Vector3 axisZ = AZ::Vector3::CreateAxisZ(); { AZ::Obb obb = AZ::Obb::CreateFromPositionRotationAndHalfLengths( AZ::Vector3(0.0f, -3.9f, 0.0f), AZ::Quaternion::CreateIdentity(), AZ::Vector3::CreateOne()); diff --git a/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp b/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp index 4570d79b83..b7b3c9c952 100644 --- a/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/SimdMathTests.cpp @@ -1414,7 +1414,6 @@ namespace UnitTest typename VectorType::Int32Type testVector = VectorType::ConvertToInt(sourceVector); VectorType::StoreUnaligned(testStoreValues, testVector); - int32_t results[4] = { 0, 1, -1, 2 }; for (int32_t i = 0; i < VectorType::ElementCount; ++i) { EXPECT_THAT(testStoreValues[i], testWholeLoadValues[i]); @@ -1476,7 +1475,6 @@ namespace UnitTest typename VectorType::Int32Type testVector = VectorType::ConvertToIntNearest(sourceVector); VectorType::StoreUnaligned(testStoreValues, testVector); - int32_t results[4] = { 0, 1, -1, 2 }; for (int32_t i = 0; i < VectorType::ElementCount; ++i) { EXPECT_THAT(testStoreValues[i], testWholeLoadValues[i]); diff --git a/Code/Framework/AzCore/Tests/Memory/LeakDetection.cpp b/Code/Framework/AzCore/Tests/Memory/LeakDetection.cpp index ce94ce14f2..b4f129bb48 100644 --- a/Code/Framework/AzCore/Tests/Memory/LeakDetection.cpp +++ b/Code/Framework/AzCore/Tests/Memory/LeakDetection.cpp @@ -76,7 +76,6 @@ namespace UnitTest return true; } - AZ::Debug::DrillerManager* m_drillerManager = nullptr; bool m_leakDetected = false; bool m_leakExpected = false; };