This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit da5c8a22e4ea82a12a4a329a529062243b0c9b33
Author: Damjan Jovanovic <[email protected]>
AuthorDate: Fri May 9 17:53:20 2025 +0200

    Test for October properly. Month 10 will fail both of these tests
            else if (month > 6 && month < 10) { quarter = "Q3"; longQuarter = 
"3rd quarter"; }
            else if (month > 10 && month < 13) {quarter = "Q4"; longQuarter = 
"4th quarter"; }
    as 10 is neither greater nor lesser than 10.
    Rewrite the comparison to include 10 properly, and clean it up.
    
    Patch by: me
    Fixes: https://bz.apache.org/ooo/show_bug.cgi?id=94658
---
 test/testuno/source/api/i18n/XExtendedCalendarTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/testuno/source/api/i18n/XExtendedCalendarTest.java 
b/test/testuno/source/api/i18n/XExtendedCalendarTest.java
index bb9f24f482..0a50936a5d 100644
--- a/test/testuno/source/api/i18n/XExtendedCalendarTest.java
+++ b/test/testuno/source/api/i18n/XExtendedCalendarTest.java
@@ -119,9 +119,9 @@ public class XExtendedCalendarTest {
         int month = cal.get(Calendar.MONTH) + 1;
         String quarter = "Q1";
         String longQuarter = "1st quarter";
-        if (month > 3 && month < 7) { quarter = "Q2"; longQuarter = "2nd 
quarter"; }
-        else if (month > 6 && month < 10) { quarter = "Q3"; longQuarter = "3rd 
quarter"; }
-        else if (month > 10 && month < 13) {quarter = "Q4"; longQuarter = "4th 
quarter"; }
+        if (4 <= month && month <= 6) { quarter = "Q2"; longQuarter = "2nd 
quarter"; }
+        else if (7 <= month && month <= 9) { quarter = "Q3"; longQuarter = 
"3rd quarter"; }
+        else if (10 <= month && month <= 12) {quarter = "Q4"; longQuarter = 
"4th quarter"; }
         expectedStringResult[3] = quarter;
         expectedStringResult[4] = longQuarter;
         

Reply via email to