Fix broken TestHebrewCalendarInTemporalLeapYear

This test started failing after the onset of Hebrew calendar year 5784,
which started the evening of 15 September 2023 CE, includes a leap
month, and continues into 2024 CE which has a leap day.

https://github.com/unicode-org/icu/pull/2610
This commit is contained in:
Yaakov Selkowitz 2023-12-13 09:49:32 -05:00
parent 92b6490c32
commit a75d097e82
2 changed files with 41 additions and 1 deletions

View File

@ -8,7 +8,7 @@
Name: icu Name: icu
Version: 73.2 Version: 73.2
Release: 2%{?dist} Release: 3%{?dist}
Summary: International Components for Unicode Summary: International Components for Unicode
License: Unicode-DFS-2016 AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain License: Unicode-DFS-2016 AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
@ -23,6 +23,10 @@ Source5: https://raw.githubusercontent.com/unicode-org/icu-data/main/tzdata/ic
%endif %endif
Source10: icu-config.sh Source10: icu-config.sh
# Fix broken TestHebrewCalendarInTemporalLeapYear
# https://github.com/unicode-org/icu/pull/2610 (fixed in icu 74)
Patch0: intltest-fix-hebrew-cal.patch
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: doxygen, autoconf, python3 BuildRequires: doxygen, autoconf, python3
@ -193,6 +197,9 @@ LD_LIBRARY_PATH=lib:stubdata:tools/ctestfw:$LD_LIBRARY_PATH bin/uconv -l
%changelog %changelog
* Wed Dec 13 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 73.2-3
- Fix broken TestHebrewCalendarInTemporalLeapYear
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 73.2-2 * Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 73.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -0,0 +1,33 @@
From f3b869cbb0b9ced42d7ca4e24626a868a14ddcfc Mon Sep 17 00:00:00 2001
From: Frank Tang <ftang@chromium.org>
Date: Mon, 18 Sep 2023 20:20:42 -0700
Subject: [PATCH] ICU-22512 Fix broken TestHebrewCalendarInTemporalLeapYear
Fix broken test mistakenly landed in
https://github.com/unicode-org/icu/pull/2274
Some important steps were missed in the last landing.
---
icu4c/source/test/intltest/caltest.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/icu4c/source/test/intltest/caltest.cpp b/icu4c/source/test/intltest/caltest.cpp
index 9d89f468eef0..18b96f231ba3 100644
--- a/source/test/intltest/caltest.cpp
+++ b/source/test/intltest/caltest.cpp
@@ -4028,6 +4028,7 @@ void CalendarTest::TestHebrewCalendarInTemporalLeapYear() {
for (gc.set(startYear, UCAL_JANUARY, 1);
gc.get(UCAL_YEAR, status) <= stopYear;
gc.add(UCAL_DATE, incrementDays, status)) {
+ cal->setTime(gc.getTime(status), status);
if (failure(status, "add/get/set/getTime/setTime incorrect")) return;
int32_t cal_year = cal->get(UCAL_EXTENDED_YEAR, status);
@@ -4036,6 +4037,7 @@ void CalendarTest::TestHebrewCalendarInTemporalLeapYear() {
leapTest->set(UCAL_MONTH, 0);
leapTest->set(UCAL_DATE, 1);
// If 10 months after TISHRI is TAMUZ, then it is a leap year.
+ leapTest->add(UCAL_MONTH, 10, status);
hasLeapMonth = leapTest->get(UCAL_MONTH, status) == icu::HebrewCalendar::TAMUZ;
yearForHasLeapMonth = cal_year;
}