From b89e2b95375f454ba8e1121fcca39dac596533d5 Mon Sep 17 00:00:00 2001 From: Chris Peyer Date: Mon, 8 Nov 2010 13:14:06 -0800 Subject: [PATCH] Bug 606478: Update testcase to cover larger date range (r=cpeyer) --- test/acceptance/regress/bug_606478.as | 153 +++++++++++++++++++--------------- test/acceptance/testconfig.txt | 5 +- 2 files changed, 88 insertions(+), 70 deletions(-) diff --git a/test/acceptance/regress/bug_606478.as b/test/acceptance/regress/bug_606478.as index 48cf1be1..db96424c 100755 --- a/test/acceptance/regress/bug_606478.as +++ b/test/acceptance/regress/bug_606478.as @@ -1,69 +1,84 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is [Open Source Virtual Machine.]. - * - * The Initial Developer of the Original Code is - * Adobe System Incorporated. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adobe AS3 Team - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** - * -* See http://bugzilla.mozilla.org/show_bug.cgi?id=606478 -* -*/ - -var SECTION = "606478"; -var VERSION = "AS3"; -var TITLE = "Bug 606478"; -var bug = "606478"; - -startTest(); -writeHeaderToLog(SECTION + " " + TITLE); -var testcases = getTestCases(); -test(); - - -function getTestCases() { - - var array:Array = new Array(); - var status:String = ''; - var actual:String = ''; - var expect:String= ''; - - var d2:Date = new Date(2010, 2, 14, 2); - status = "new Date(2010, 2, 14, 2)"; - - actual = d2.toLocaleString(); - expect = "Sun Mar 14 2010 03:00:00 AM"; - - array[0] = new TestCase(SECTION, status, expect, actual); - - return array; -} +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is [Open Source Virtual Machine.]. + * + * The Initial Developer of the Original Code is + * Adobe System Incorporated. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Adobe AS3 Team + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** + * +* See http://bugzilla.mozilla.org/show_bug.cgi?id=606478 +* +*/ + +var SECTION = "606478"; +var VERSION = "AS3"; +var TITLE = "Bug 606478 - Test only works in North America"; +var bug = "606478"; + +startTest(); +writeHeaderToLog(SECTION + " " + TITLE); +var testcases = getTestCases(); +test(); + + +function getTestCases() { + + var array:Array = new Array(); + var status:String = ''; + var actual:String = ''; + var expect:String= ''; + var x:int = 0; + + // Check DST start for 1990-2006 (first sunday in april) + for (var year=1990; year<=2006; year++) { + // Get the correct sunday + var date:Date = new Date(GetFirstSundayInApril(TimeFromYear(year))); + // set the time to 2 am + actual = (new Date(date.toLocaleDateString()+" 02:00:00 AM")).toLocaleString(); + status = "new Date("+date.toLocaleDateString()+" 02:00:00 AM)"; + expect = date.toLocaleDateString()+" 03:00:00 AM" + array[x++] = new TestCase(SECTION, status, expect, actual); + } + + // Check DST start for 2007-2015 (second sunday in march) + for (var year=2007; year<=2015; year++) { + // Get the correct sunday + var date:Date = new Date(GetSecondSundayInMarch(TimeFromYear(year))); + // set the time to 2 am + actual = (new Date(date.toLocaleDateString()+" 02:00:00 AM")).toLocaleString(); + status = "new Date("+date.toLocaleDateString()+" 02:00:00 AM)"; + expect = date.toLocaleDateString()+" 03:00:00 AM" + array[x++] = new TestCase(SECTION, status, expect, actual); + } + + return array; +} diff --git a/test/acceptance/testconfig.txt b/test/acceptance/testconfig.txt index 92dd0ed9..08a8c831 100755 --- a/test/acceptance/testconfig.txt +++ b/test/acceptance/testconfig.txt @@ -68,7 +68,8 @@ util/shell_ats, .*, skip, shell file for ats media creation # BUGS: # Grouped by feature or platform -regress/bug_606478, mips-lnx-tvm.*, expectedfail, https://bugzilla.mozilla.org/show_bug.cgi?id=606478 +# Some operating systems do not adjust past dates for historical DST settings +regress/bug_606478:.*(19\d\d|200[0-6]).*, (mips-lnx|win(?!.*diff)).*, expectedfail, Operating system does not adjust past dates for historical DST settings # https://bugzilla.mozilla.org/show_bug.cgi?id=541358 mmgc/outofmemory , .* , skip, https://bugzilla.mozilla.org/show_bug.cgi?id=541358 @@ -551,3 +552,5 @@ ecma3/Expressions/e11_2_1_5, ppc64-mac-tvm-(?!.*Dinterp).*, expectedfail, https: ecma3/ObjectObjects/e15_2_1_1_rt, ppc64-mac-tvm-(?!.*Dinterp).*, expectedfail, https://bugzilla.mozilla.org/show_bug.cgi?id=608130 ecma3/ObjectObjects/e15_2_2_1_rt, ppc64-mac-tvm-(?!.*Dinterp).*, expectedfail, https://bugzilla.mozilla.org/show_bug.cgi?id=608130 ecma3/TypeConversion/e9_9_1_rt, ppc64-mac-tvm-(?!.*Dinterp).*, expectedfail, https://bugzilla.mozilla.org/show_bug.cgi?id=608130 + + -- 2.11.4.GIT