From 920a98bf83f4c52efc74198d8f566a5da912dcec Mon Sep 17 00:00:00 2001 From: Sylvain Joube Date: Thu, 2 May 2024 22:11:20 +0200 Subject: [PATCH] Test size 0 only one error --- test/algorithm/algos/binary_search.cpp | 52 +++++++++++++------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/test/algorithm/algos/binary_search.cpp b/test/algorithm/algos/binary_search.cpp index 88706625..34580f33 100644 --- a/test/algorithm/algos/binary_search.cpp +++ b/test/algorithm/algos/binary_search.cpp @@ -147,32 +147,32 @@ TTS_CASE("Check for kwk::lower_bound(In, value, func) 1D with function") // std::cout << (*kwk::lower_bound(view, 21))[0] << std::endl; }; -// TTS_CASE("Check for kwk::lower_bound 1D: size 0") -// { -// const std::size_t input_size = 0; -// std::array input; -// auto view = kwk::view{kwk::source = input, kwk::of_size(input_size)}; -// auto func = [](auto const& input_, auto const& element_) { return input_ < (element_ - 10) * 2; }; - -// LB_ERROR(input, view, -2984612); -// LB_ERROR(input, view, -2); -// LB_ERROR(input, view, 0); -// LB_ERROR(input, view, 5); -// LB_ERROR(input, view, 19); -// LB_ERROR(input, view, 20); -// LB_ERROR(input, view, 21); -// LB_ERROR(input, view, 78456465); - -// LB_ERROR_FUNC(input, view, func, -2984612); -// LB_ERROR_FUNC(input, view, func, -2); -// LB_ERROR_FUNC(input, view, func, 0); -// LB_ERROR_FUNC(input, view, func, 5); -// LB_ERROR_FUNC(input, view, func, 9); -// LB_ERROR_FUNC(input, view, func, 19); -// LB_ERROR_FUNC(input, view, func, 20); -// LB_ERROR_FUNC(input, view, func, 21); -// LB_ERROR_FUNC(input, view, func, 78456465); -// }; +TTS_CASE("Check for kwk::lower_bound 1D: size 0") +{ + const std::size_t input_size = 0; + std::array input; + auto view = kwk::view{kwk::source = input, kwk::of_size(input_size)}; + auto func = [](auto const& input_, auto const& element_) { return input_ < (element_ - 10) * 2; }; + + LB_ERROR(input, view, -2984612); + // LB_ERROR(input, view, -2); + // LB_ERROR(input, view, 0); + // LB_ERROR(input, view, 5); + // LB_ERROR(input, view, 19); + // LB_ERROR(input, view, 20); + // LB_ERROR(input, view, 21); + // LB_ERROR(input, view, 78456465); + + // LB_ERROR_FUNC(input, view, func, -2984612); + // LB_ERROR_FUNC(input, view, func, -2); + // LB_ERROR_FUNC(input, view, func, 0); + // LB_ERROR_FUNC(input, view, func, 5); + // LB_ERROR_FUNC(input, view, func, 9); + // LB_ERROR_FUNC(input, view, func, 19); + // LB_ERROR_FUNC(input, view, func, 20); + // LB_ERROR_FUNC(input, view, func, 21); + // LB_ERROR_FUNC(input, view, func, 78456465); +}; TTS_CASE("Check for kwk::upper_bound(In, value) 1D ---------")