[libcxx-commits] [libcxx] [libc++][chrono][test] Fixes bogus loops. (PR #101890)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Aug 4 07:20:24 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

<details>
<summary>Changes</summary>

Changes the loop range to match similar tests and avoids zero iterations. The original motivation to reduce the number of iterations was to allow the test to be executed during constant evaluation.

Fixes: https://github.com/llvm/llvm-project/issues/100502

---
Full diff: https://github.com/llvm/llvm-project/pull/101890.diff


1 Files Affected:

- (modified) libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp (+2-2) 


``````````diff
diff --git a/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
index e28b6d8609bc4..5d2aa48718603 100644
--- a/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
+++ b/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/comparisons.pass.cpp
@@ -59,8 +59,8 @@ constexpr bool test() {
                                 : std::strong_ordering::greater)));
 
   //  same month, different years
-  for (int i = 1000; i < 20; ++i)
-    for (int j = 1000; j < 20; ++j)
+  for (int i = 1000; i < 1010; ++i)
+    for (int j = 1000; j < 1010; ++j)
       assert((testOrder(year_month_day_last{year{i}, month_day_last{January}},
                         year_month_day_last{year{j}, month_day_last{January}},
                         i == j  ? std::strong_ordering::equal

``````````

</details>


https://github.com/llvm/llvm-project/pull/101890


More information about the libcxx-commits mailing list