OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #include "SkTime.h" |
| 9 #include "Test.h" |
| 10 |
| 11 // Sanity checks for the GetDateTime function. |
| 12 DEF_TEST(Time_GetDateTime, r) { |
| 13 SkTime::DateTime dateTime; |
| 14 SkTime::GetDateTime(&dateTime); |
| 15 |
| 16 // TODO(future generation): update these values. |
| 17 const uint16_t kMinimumSaneYear = 2014; |
| 18 const uint16_t kMaximumSaneYear = 2064; |
| 19 REPORTER_ASSERT(r, dateTime.fYear >= kMinimumSaneYear); |
| 20 REPORTER_ASSERT(r, dateTime.fYear <= kMaximumSaneYear); |
| 21 |
| 22 REPORTER_ASSERT(r, dateTime.fMonth >= 1); |
| 23 REPORTER_ASSERT(r, dateTime.fMonth <= 12); |
| 24 |
| 25 REPORTER_ASSERT(r, dateTime.fDay >= 1); |
| 26 REPORTER_ASSERT(r, dateTime.fDay <= 31); |
| 27 |
| 28 REPORTER_ASSERT(r, dateTime.fHour <= 23); |
| 29 |
| 30 REPORTER_ASSERT(r, dateTime.fMinute <= 59); |
| 31 |
| 32 REPORTER_ASSERT(r, dateTime.fSecond <= 60); // leap seconds are 23:59:60 |
| 33 } |
OLD | NEW |