Skip to content

Commit

Permalink
[oneDPL][ranges][tests] a fix for std::ranges::stable_sort usage for …
Browse files Browse the repository at this point in the history
…windows standard C++ library
  • Loading branch information
MikeDvorskiy committed Oct 23, 2024
1 parent bc253fb commit a4b1db9
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::stable_sort, std::ranges::stable_sort);
test_range_algo<1>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::less{});
auto sort_stable_checker =
#if _ONEDPL_STD_RANGES_ALGO_CPP_FUN
[](auto&&... __args) { return std::ranges::stable_sort(std::forward<decltype(__args)>(__args)...); };
#else
std::ranges::stable_sort;
#endif

test_range_algo<2>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::less{}, proj);
test_range_algo<3>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::greater{}, proj);
test_range_algo<0>{big_sz}(dpl_ranges::stable_sort, sort_stable_checker);
test_range_algo<1>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::less{});

test_range_algo<4, P2>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::less{}, &P2::x);
test_range_algo<5, P2>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::greater{}, &P2::x);
test_range_algo<2>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::less{}, proj);
test_range_algo<3>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::greater{}, proj);

test_range_algo<6, P2>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::less{}, &P2::proj);
test_range_algo<7, P2>{}(dpl_ranges::stable_sort, std::ranges::stable_sort, std::ranges::greater{}, &P2::proj);
test_range_algo<4, P2>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::less{}, &P2::x);
test_range_algo<5, P2>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::greater{}, &P2::x);

test_range_algo<6, P2>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::less{}, &P2::proj);
test_range_algo<7, P2>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::greater{}, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down

0 comments on commit a4b1db9

Please sign in to comment.