Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Side by Side Diff: tests/Time.cpp

Issue 1109593002: SkTime: return timezone information (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reorder assignment Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ports/SkTime_win.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTime.h" 8 #include "SkTime.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 23 matching lines...) Expand all
34 REPORTER_ASSERT(r, dateTime.fMonth <= 12); 34 REPORTER_ASSERT(r, dateTime.fMonth <= 12);
35 35
36 REPORTER_ASSERT(r, dateTime.fDay >= 1); 36 REPORTER_ASSERT(r, dateTime.fDay >= 1);
37 REPORTER_ASSERT(r, dateTime.fDay <= 31); 37 REPORTER_ASSERT(r, dateTime.fDay <= 31);
38 38
39 REPORTER_ASSERT(r, dateTime.fHour <= 23); 39 REPORTER_ASSERT(r, dateTime.fHour <= 23);
40 40
41 REPORTER_ASSERT(r, dateTime.fMinute <= 59); 41 REPORTER_ASSERT(r, dateTime.fMinute <= 59);
42 42
43 REPORTER_ASSERT(r, dateTime.fSecond <= 60); // leap seconds are 23:59:60 43 REPORTER_ASSERT(r, dateTime.fSecond <= 60); // leap seconds are 23:59:60
44
45 // The westernmost timezone is -12:00.
46 // The easternmost timezone is +14:00.
47 REPORTER_ASSERT(r, abs(SkToInt(dateTime.fTimeZoneMinutes)) <= 14 * 60);
48
49 SkString timeStamp;
50 dateTime.toISO8601(&timeStamp);
51 REPORTER_ASSERT(r, timeStamp.size() > 0);
52 if (r->verbose()) { // `dm --veryVerbose`
53 SkDebugf("\nCurrent Time (ISO-8601 format): \"%s\"\n",
54 timeStamp.c_str());
55 }
44 } 56 }
OLDNEW
« no previous file with comments | « src/ports/SkTime_win.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698