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

Unified Diff: tests/Time.cpp

Issue 711143002: tests/Time.cpp: more verbose errors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Time.cpp
diff --git a/tests/Time.cpp b/tests/Time.cpp
index 65c01e26ffc2136e706fa941ceb57579cb85af30..0139654e1993ec51d711f86d1ff21ea43093c436 100644
--- a/tests/Time.cpp
+++ b/tests/Time.cpp
@@ -14,10 +14,21 @@ DEF_TEST(Time_GetDateTime, r) {
SkTime::GetDateTime(&dateTime);
// TODO(future generation): update these values.
- const uint16_t kMinimumSaneYear = 2014;
+ const uint16_t kMinimumSaneYear = 1964;
const uint16_t kMaximumSaneYear = 2064;
- REPORTER_ASSERT(r, dateTime.fYear >= kMinimumSaneYear);
- REPORTER_ASSERT(r, dateTime.fYear <= kMaximumSaneYear);
+
+ if (dateTime.fYear < kMinimumSaneYear) {
+ ERRORF(r,
+ "SkTime::GetDateTime: %u (CurrentYear) < %u (MinimumSaneYear)",
+ static_cast<unsigned>(dateTime.fYear),
+ static_cast<unsigned>(kMinimumSaneYear));
+ }
+ if (dateTime.fYear > kMaximumSaneYear) {
+ ERRORF(r,
+ "SkTime::GetDateTime: %u (CurrentYear) > %u (MaximumSaneYear)",
+ static_cast<unsigned>(dateTime.fYear),
+ static_cast<unsigned>(kMaximumSaneYear));
+ }
REPORTER_ASSERT(r, dateTime.fMonth >= 1);
REPORTER_ASSERT(r, dateTime.fMonth <= 12);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698