2005-08-16 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / class / Microsoft.JScript / Test / Mozilla / ecma / Date / 15.9.5.11-3.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\r
2 /* ***** BEGIN LICENSE BLOCK *****\r
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1\r
4  *\r
5  * The contents of this file are subject to the Mozilla Public License Version\r
6  * 1.1 (the "License"); you may not use this file except in compliance with\r
7  * the License. You may obtain a copy of the License at\r
8  * http://www.mozilla.org/MPL/\r
9  *\r
10  * Software distributed under the License is distributed on an "AS IS" basis,\r
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r
12  * for the specific language governing rights and limitations under the\r
13  * License.\r
14  *\r
15  * The Original Code is Mozilla Communicator client code, released\r
16  * March 31, 1998.\r
17  *\r
18  * The Initial Developer of the Original Code is\r
19  * Netscape Communications Corporation.\r
20  * Portions created by the Initial Developer are Copyright (C) 1998\r
21  * the Initial Developer. All Rights Reserved.\r
22  *\r
23  * Contributor(s):\r
24  *\r
25  * Alternatively, the contents of this file may be used under the terms of\r
26  * either the GNU General Public License Version 2 or later (the "GPL"), or\r
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),\r
28  * in which case the provisions of the GPL or the LGPL are applicable instead\r
29  * of those above. If you wish to allow use of your version of this file only\r
30  * under the terms of either the GPL or the LGPL, and not to allow others to\r
31  * use your version of this file under the terms of the MPL, indicate your\r
32  * decision by deleting the provisions above and replace them with the notice\r
33  * and other provisions required by the GPL or the LGPL. If you do not delete\r
34  * the provisions above, a recipient may use your version of this file under\r
35  * the terms of any one of the MPL, the GPL or the LGPL.\r
36  *\r
37  * ***** END LICENSE BLOCK ***** */\r
38 \r
39 /**\r
40    File Name:          15.9.5.11.js\r
41    ECMA Section:       15.9.5.11\r
42    Description:        Date.prototype.getUTCDate\r
43 \r
44    1.Let t be this time value.\r
45    2.If t is NaN, return NaN.\r
46    1.Return DateFromTime(t).\r
47 \r
48    Author:             christine@netscape.com\r
49    Date:               12 november 1997\r
50 */\r
51 \r
52 var SECTION = "15.9.5.11";\r
53 var VERSION = "ECMA_1";\r
54 startTest();\r
55 var TITLE   = "Date.prototype.getUTCDate()";\r
56 \r
57 writeHeaderToLog( SECTION + " "+ TITLE);\r
58 \r
59 var TZ_ADJUST = TZ_DIFF * msPerHour;\r
60 \r
61 addTestCase( TIME_1970 );\r
62 \r
63 test();\r
64 \r
65 function addTestCase( t ) {\r
66   for ( var m = 0; m < 11; m++ ) {\r
67     t += TimeInMonth(m);\r
68 \r
69     for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {\r
70       t += d;\r
71       new TestCase( SECTION,\r
72                     "(new Date("+t+")).getUTCDate()",\r
73                     DateFromTime((t)),\r
74                     (new Date(t)).getUTCDate() );\r
75 /*\r
76   new TestCase( SECTION,\r
77   "(new Date("+(t+1)+")).getUTCDate()",\r
78   DateFromTime((t+1)),\r
79   (new Date(t+1)).getUTCDate() );\r
80 \r
81   new TestCase( SECTION,\r
82   "(new Date("+(t-1)+")).getUTCDate()",\r
83   DateFromTime((t-1)),\r
84   (new Date(t-1)).getUTCDate() );\r
85 \r
86   new TestCase( SECTION,\r
87   "(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",\r
88   DateFromTime((t-TZ_ADJUST)),\r
89   (new Date(t-TZ_ADJUST)).getUTCDate() );\r
90 \r
91   new TestCase( SECTION,\r
92   "(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",\r
93   DateFromTime((t+TZ_ADJUST)),\r
94   (new Date(t+TZ_ADJUST)).getUTCDate() );\r
95 */\r
96     }\r
97   }\r
98 }\r