Skip to content

Fixes for calendar initialization #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2015
Merged

Fixes for calendar initialization #72

merged 1 commit into from
Dec 8, 2015

Conversation

brownleej
Copy link

This is copied from #44, which got closed when I reorganized the branches and split up the request into two parts.

This request is to fix a few related bugs in initializing calendars and getting date information out of them:

  • It adds a mapping for the "leap month" field
  • It adds support for the Chinese calendar, which was disabled in the initial commit but seems to be working now.
  • It fixes a bug that occurred when a calendar could not be fully initialized. Some of the fields were being left null, but were later given to CFRelease without a check for nulls.

…in NSCalendar.

Fixes a crash caused by trying to deallocate a CFCalendar that hadn't been fully initialized.
Re-enables support for the Chinese calendar.
Adds tests for initializaing NSCalendar and fetching basic date info.
parkera added a commit that referenced this pull request Dec 8, 2015
Fixes for calendar initialization
@parkera parkera merged commit 15beaf9 into swiftlang:master Dec 8, 2015
@parkera
Copy link
Contributor

parkera commented Dec 8, 2015

Thanks!

@thii
Copy link
Contributor

thii commented Dec 9, 2015

Not sure if it is just me but the following tests are failing:

  • test_gettingDatesOnGregorianCalendar:
XCTAssertEqual(components.day, 5)
$ (lldb) po components.day
$ 6
  • test_gettingDatesOnHebrewCalendar:
XCTAssertEqual(components.day, 7)
$ (lldb) po components.day
$ 8
  • test_gettingDatesOnChineseCalendar:
XCTAssertEqual(components.day, 15)
$ (lldb) po components.day
$ 16

Not sure if it is related to timezone or not but my timezone is JST (GMT+9).

@brownleej brownleej deleted the calendar-date-fix branch December 9, 2015 17:22
@parkera
Copy link
Contributor

parkera commented Dec 9, 2015

@thii can you open a bug for us at bugs.swift.org?

@thii
Copy link
Contributor

thii commented Dec 10, 2015

I opened one here https://bugs.swift.org/browse/SR-171.
Apparently, they seem to be only failed at several timezones (so no one realized it).
@brownleej Can you have a look?

atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Apr 29, 2021
Make sure swiftlang/swift#34023, which removes /usr/lib/swift/linux from the RUNPATH of several Swift libraries, stays that way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants