[libcxx-commits] [libcxx] [libc++][chrono][test] Fixes bogus loops. (PR #101890)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Aug 4 07:19:52 PDT 2024
https://github.com/mordante created https://github.com/llvm/llvm-project/pull/101890
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
>From 07b1fc2504d0e057094e6c9fab5346a2f375bdee Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Sun, 4 Aug 2024 16:16:57 +0200
Subject: [PATCH] [libc++][chrono][test] Fixes bogus loops.
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
---
.../time.cal.ymdlast.nonmembers/comparisons.pass.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
More information about the libcxx-commits
mailing list