[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sum up of current failures
From: |
Richard Frith-Macdonald |
Subject: |
Re: Sum up of current failures |
Date: |
Fri, 22 Mar 2013 14:33:34 +0000 |
On 22 Mar 2013, at 13:49, Luboš Doležel wrote:
> On Fri, 22 Mar 2013 14:24:01 +0100, Riccardo Mottola wrote:
>> Hi,
>> given the different failures, I retested everything. I Installed ICU
>> on my NetBSD machine, so that calendar tests can be included.
>>
>> Here my setup.
>>
>> NetBSD i386-32, GCC, icu-50
>> 3 failures, two of which I reported yesterday:
>> base/NSCalendar/features-10-7.m:
>> Failed test: features-10-7.m:33 ... -weekOfMonth returns the
>> correct week
>
> I think I understand the test failure now. For the US guys, 2012-12-31 is in
> the fifth week of month, but in the UK, it is actually the sixth.
>
> Adding [cal setFirstWeekday:1] (where 1 is Sunday) into the code should
> hopefully fix the problem. Could you please verify that?
It's a nice thought, but I don't think it can be right.
December 2012 started on Saturday 1st and ended on Monday 31st
If our week starts on a Sunday, then
Saturday 1st is the last day in week 0
Sunday 2nd is in week 1 (as is Monday 3rd)
and Monday 31st is in week 5
If our week starts on a Monday, then
Saturday 1st is in week 0, as is Sunday 1st
Monday 2nd is still in week 1
and Monday 31st is still in week 5
So either way the -weekOfMonth method should return 5 for the 31st of December
2012