Closed Bug 1947875 Opened 1 month ago Closed 28 days ago

Fix wrong use of Some() in AppDateTimeFormat::Format

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: Yury.Ivanovich, Assigned: Yury.Ivanovich)

References

Details

Attachments

(1 file)

This is related to bug 1796042 where this observation was made in https://phabricator.services.mozilla.com/D197989#6967031:

timeZoneID doesn't survive Some. The resulting Maybe<Span<const char16_t>> has the right length (3 or 9 characters) but the characters themselves aren't initialised (0xffffffff).

That's correct as the Some() call seems to be wrong. It will be corrected in the patch I'm going to attach. Note that the test fails if the code fix is removed.

Assignee: nobody → Yury.Ivanovich
Status: NEW → ASSIGNED
See Also: → 1796042
Blocks: 1796042
See Also: 1796042

Sorry, I mostly work on TB bugs, they have a checkin-needed-tb keyword. How does one request landing this patch?

Flags: needinfo?(gtatum)

Looks like adding "Check-in Needed" as a Phab tag is the way to go.

Flags: needinfo?(gtatum)
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/6a6f56d7cd12 Fix wrong use of Some() in AppDateTimeFormat::Format. r=gregtatum

Backed out for causing gtest failures @AppDateTimeFormat.

Flags: needinfo?(Yury.Ivanovich)
Severity: -- → S3
Priority: -- → P3

Sorry about the test failure. The test worked locally on Windows. According to the log from Linux, the failure is:
TEST-UNEXPECTED-FAIL | AppDateTimeFormat.FormatPRExplodedTime | Value of: formattedTime.Find(u"-09:13") != kNotFound.

When I get back to my dev machine, I'll see how it behaves on Linux and/or when run in a different time zone.

For the test to pass, it also needs to check for "-9:13" on Linux. I won't have access to my dev machine for a while, so if someone wants to modify the patch like this, that would be appreciated:

+++ b/intl/locale/tests/gtest/TestAppDateTimeFormat.cpp
@@ -106,9 +106,10 @@ TEST(AppDateTimeFormat, FormatPRExploded
   // From above: Wed, 31 Dec 1969 14:47:00 -09:13
   rv = AppDateTimeFormat::Format(components, &prExplodedTime, formattedTime);
   ASSERT_NS_SUCCEEDED(rv);
   ASSERT_TRUE(formattedTime.Find(u"Wed") != kNotFound);
-  ASSERT_TRUE(formattedTime.Find(u"-09:13") != kNotFound);
+  ASSERT_TRUE(formattedTime.Find(u"-09:13") != kNotFound ||
+              formattedTime.Find(u"-9:13") != kNotFound);
 }
 
 TEST(AppDateTimeFormat, DateFormatSelectors)
 {
Flags: needinfo?(Yury.Ivanovich) → needinfo?(gtatum)
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/04974c6e86d7 Fix wrong use of Some() in AppDateTimeFormat::Format. r=gregtatum

Thanks, welpy-cw, and sorry about my limited availability.

Flags: needinfo?(gtatum)
Status: ASSIGNED → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: