From a73d728b91fa0770aafd82ac53f317370623cee2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 27 Feb 2023 11:47:23 -0800 Subject: [PATCH 1/4] Dev09_056375_locale_cleanup: Add preprocessor comments. --- tests/std/tests/Dev09_056375_locale_cleanup/test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp b/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp index 11a5f969769..d05a5e45612 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp +++ b/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp @@ -25,7 +25,7 @@ void test_dll() { as->GetType("Test")->GetMethod("DllTest")->Invoke(nullptr, nullptr); AppDomain::Unload(ad); } -#else +#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv HMODULE hLibrary = LoadLibraryExW(L"testdll.dll", nullptr, 0); assert(hLibrary != nullptr); typedef void (*TheFuncProc)(); @@ -33,7 +33,7 @@ void test_dll() { assert(pFunc != nullptr); pFunc(); FreeLibrary(hLibrary); -#endif +#endif // ^^^ !defined(_M_CEE) ^^^ } void test_exe_part1() { From 56f395ab249a9e866b0ca54b46d9bca10d16c71d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 27 Feb 2023 11:47:48 -0800 Subject: [PATCH 2/4] Dev09_056375_locale_cleanup: Drop totally unnecessary using-directive. --- tests/std/tests/Dev09_056375_locale_cleanup/test.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp b/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp index d05a5e45612..f0c89ce26fd 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp +++ b/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp @@ -51,9 +51,6 @@ void test_exe_part2() { } int main() { -#ifdef _M_CEE - using namespace System; -#endif test_exe_part1(); test_dll(); test_exe_part2(); From e4c8e991ba116ab5df0767c176598704fc223002 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 27 Feb 2023 11:49:05 -0800 Subject: [PATCH 3/4] Dev09_056375_locale_cleanup: Change C cast to reinterpret_cast. --- tests/std/tests/Dev09_056375_locale_cleanup/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp b/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp index f0c89ce26fd..7a7cd8f9bf4 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp +++ b/tests/std/tests/Dev09_056375_locale_cleanup/test.cpp @@ -29,7 +29,7 @@ void test_dll() { HMODULE hLibrary = LoadLibraryExW(L"testdll.dll", nullptr, 0); assert(hLibrary != nullptr); typedef void (*TheFuncProc)(); - TheFuncProc pFunc = (TheFuncProc) GetProcAddress(hLibrary, "DllTest"); + TheFuncProc pFunc = reinterpret_cast(GetProcAddress(hLibrary, "DllTest")); assert(pFunc != nullptr); pFunc(); FreeLibrary(hLibrary); From ee87f4fe3f058f9dd944dbcaae56e53be1ce133e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 3 Mar 2023 08:01:15 -0800 Subject: [PATCH 4/4] tests: Avoid using `ranges` as an identifier. --- .../test.cpp | 8 +++---- tests/std/tests/P2321R2_views_zip/test.cpp | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/std/tests/Dev09_192736_tr1_prngs_not_copyconstructible/test.cpp b/tests/std/tests/Dev09_192736_tr1_prngs_not_copyconstructible/test.cpp index 3e76543f177..e99bb81b1fc 100644 --- a/tests/std/tests/Dev09_192736_tr1_prngs_not_copyconstructible/test.cpp +++ b/tests/std/tests/Dev09_192736_tr1_prngs_not_copyconstructible/test.cpp @@ -157,10 +157,10 @@ int main() { test_distribution(piecewise_constant_distribution(begin(rangesf), end(rangesf), begin(weightsf))); test_distribution(piecewise_linear_distribution(begin(rangesf), end(rangesf), begin(weightsf))); - vector ranges{0.0, 10.0, 90.0, 100.0}; - vector weights{1.0, 0.0, 0.0, 1.0}; - test_distribution(piecewise_constant_distribution(begin(ranges), end(ranges), begin(weights))); - test_distribution(piecewise_linear_distribution(begin(ranges), end(ranges), begin(weights))); + vector rangesd{0.0, 10.0, 90.0, 100.0}; + vector weightsd{1.0, 0.0, 0.0, 1.0}; + test_distribution(piecewise_constant_distribution(begin(rangesd), end(rangesd), begin(weightsd))); + test_distribution(piecewise_linear_distribution(begin(rangesd), end(rangesd), begin(weightsd))); vector rangesl{0.0l, 10.0l, 90.0l, 100.0l}; vector weightsl{1.0l, 0.0l, 0.0l, 1.0l}; diff --git a/tests/std/tests/P2321R2_views_zip/test.cpp b/tests/std/tests/P2321R2_views_zip/test.cpp index 3b7dda50219..ebfa1d24314 100644 --- a/tests/std/tests/P2321R2_views_zip/test.cpp +++ b/tests/std/tests/P2321R2_views_zip/test.cpp @@ -17,7 +17,7 @@ using namespace std; template -concept CanViewZip = requires(RangeTypes&&... ranges) { views::zip(std::forward(ranges)...); }; +concept CanViewZip = requires(RangeTypes&&... rngs) { views::zip(std::forward(rngs)...); }; template using AllView = views::all_t; @@ -226,7 +226,7 @@ constexpr bool do_tuples_reference_same_objects(const LHSTupleType& lhs_tuple, c #pragma warning(disable : 4100) // unreferenced formal parameter template -constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... ranges) { +constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... rngs) { // Ignore instances where one of the generated test ranges does not model // ranges::viewable_range. if constexpr ((ranges::viewable_range && ...)) { @@ -258,8 +258,8 @@ constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... range using ExpectedZipType = ZipType; constexpr bool is_noexcept = (is_nothrow_copy_constructible_v> && ...); - STATIC_ASSERT(same_as); - STATIC_ASSERT(noexcept(views::zip(ranges...)) == is_noexcept); + STATIC_ASSERT(same_as); + STATIC_ASSERT(noexcept(views::zip(rngs...)) == is_noexcept); } // ... with const lvalue arguments @@ -269,8 +269,8 @@ constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... range using ExpectedZipType = ranges::zip_view&>...>; constexpr bool is_noexcept = (is_nothrow_copy_constructible_v> && ...); - STATIC_ASSERT(same_as); - STATIC_ASSERT(noexcept(views::zip(as_const(ranges)...)) == is_noexcept); + STATIC_ASSERT(same_as); + STATIC_ASSERT(noexcept(views::zip(as_const(rngs)...)) == is_noexcept); } // ... with rvalue argument @@ -280,8 +280,8 @@ constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... range using ExpectedZipType = ranges::zip_view>...>; constexpr bool is_noexcept = (is_nothrow_move_constructible_v> && ...); - STATIC_ASSERT(same_as); - STATIC_ASSERT(noexcept(views::zip(std::move(ranges)...)) == is_noexcept); + STATIC_ASSERT(same_as); + STATIC_ASSERT(noexcept(views::zip(std::move(rngs)...)) == is_noexcept); } // ... with const rvalue argument @@ -291,12 +291,12 @@ constexpr bool test_one(TestContainerType& test_container, RangeTypes&&... range using ExpectedZipType = ranges::zip_view>...>; constexpr bool is_noexcept = (is_nothrow_copy_constructible_v> && ...); - STATIC_ASSERT(same_as); - STATIC_ASSERT(noexcept(views::zip(std::move(as_const(ranges))...)) == is_noexcept); + STATIC_ASSERT(same_as); + STATIC_ASSERT(noexcept(views::zip(std::move(as_const(rngs))...)) == is_noexcept); } // Validate deduction guide - same_as auto zipped_range = ranges::zip_view{std::forward(ranges)...}; + same_as auto zipped_range = ranges::zip_view{std::forward(rngs)...}; const auto tuple_element_arr = test_container.get_element_tuple_arr(); const auto const_tuple_element_arr = as_const(test_container).get_element_tuple_arr();