OLD | NEW |
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 expect = true; | 180 expect = true; |
181 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, Infinity)).getUTCSeconds())
; | 181 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, Infinity)).getUTCSeconds())
; |
182 reportCompare(expect, actual, summary + ': seconds Infinity'); | 182 reportCompare(expect, actual, summary + ': seconds Infinity'); |
183 | 183 |
184 expect = true; | 184 expect = true; |
185 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, Infinity)).getUTCMillise
conds()); | 185 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, Infinity)).getUTCMillise
conds()); |
186 reportCompare(expect, actual, summary + ': milliseconds Infinity'); | 186 reportCompare(expect, actual, summary + ': milliseconds Infinity'); |
187 | 187 |
188 // | 188 // |
189 | 189 |
190 expect = 31; | 190 expect = true; |
191 actual = (new Date(Date.UTC(2006, 0, -Infinity)).getUTCDate()); | 191 actual = isNaN(new Date(Date.UTC(2006, 0, -Infinity)).getUTCDate()); |
192 reportCompare(expect, actual, summary + ': date -Infinity'); | 192 reportCompare(expect, actual, summary + ': date -Infinity'); |
193 | 193 |
194 expect = 0; | 194 expect = true; |
195 actual = (new Date(Date.UTC(2006, 0, 0, -Infinity)).getUTCHours()); | 195 actual = isNaN(new Date(Date.UTC(2006, 0, 0, -Infinity)).getUTCHours()); |
196 reportCompare(expect, actual, summary + ': hours -Infinity'); | 196 reportCompare(expect, actual, summary + ': hours -Infinity'); |
197 | 197 |
198 expect = 0; | 198 expect = true; |
199 actual = (new Date(Date.UTC(2006, 0, 0, 0, -Infinity)).getUTCMinutes()); | 199 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, -Infinity)).getUTCMinutes()); |
200 reportCompare(expect, actual, summary + ': minutes -Infinity'); | 200 reportCompare(expect, actual, summary + ': minutes -Infinity'); |
201 | 201 |
202 expect = 0; | 202 expect = true; |
203 actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, -Infinity)).getUTCSeconds()); | 203 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, -Infinity)).getUTCSeconds()
); |
204 reportCompare(expect, actual, summary + ': seconds -Infinity'); | 204 reportCompare(expect, actual, summary + ': seconds -Infinity'); |
205 | 205 |
206 expect = 0; | 206 expect = true; |
207 actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, 0, -Infinity)).getUTCMillisecond
s()); | 207 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, -Infinity)).getUTCMillis
econds()); |
208 reportCompare(expect, actual, summary + ': milliseconds -Infinity'); | 208 reportCompare(expect, actual, summary + ': milliseconds -Infinity'); |
209 | 209 |
210 // | 210 // |
211 | 211 |
212 expect = true; | 212 expect = true; |
213 actual = isNaN(new Date(Date.UTC(2006, 0, NaN)).getUTCDate()); | 213 actual = isNaN(new Date(Date.UTC(2006, 0, NaN)).getUTCDate()); |
214 reportCompare(expect, actual, summary + ': date NaN'); | 214 reportCompare(expect, actual, summary + ': date NaN'); |
215 | 215 |
216 expect = true; | 216 expect = true; |
217 actual = isNaN(new Date(Date.UTC(2006, 0, 0, NaN)).getUTCHours()); | 217 actual = isNaN(new Date(Date.UTC(2006, 0, 0, NaN)).getUTCHours()); |
218 reportCompare(expect, actual, summary + ': hours NaN'); | 218 reportCompare(expect, actual, summary + ': hours NaN'); |
219 | 219 |
220 expect = true; | 220 expect = true; |
221 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, NaN)).getUTCMinutes()); | 221 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, NaN)).getUTCMinutes()); |
222 reportCompare(expect, actual, summary + ': minutes NaN'); | 222 reportCompare(expect, actual, summary + ': minutes NaN'); |
223 | 223 |
224 expect = true; | 224 expect = true; |
225 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, NaN)).getUTCSeconds()); | 225 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, NaN)).getUTCSeconds()); |
226 reportCompare(expect, actual, summary + ': seconds NaN'); | 226 reportCompare(expect, actual, summary + ': seconds NaN'); |
227 | 227 |
228 expect = true; | 228 expect = true; |
229 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, NaN)).getUTCMilliseconds
()); | 229 actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, NaN)).getUTCMilliseconds
()); |
230 reportCompare(expect, actual, summary + ': milliseconds NaN'); | 230 reportCompare(expect, actual, summary + ': milliseconds NaN'); |
231 | 231 |
232 exitFunc ('test'); | 232 exitFunc ('test'); |
233 } | 233 } |
OLD | NEW |