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

Unified Diff: base/build_time_unittest.cc

Issue 660753003: Put some references to __DATE__ and __TIME__ behind a preprocessor flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nit. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/build_time.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/build_time_unittest.cc
diff --git a/base/build_time_unittest.cc b/base/build_time_unittest.cc
index 399a53f953625e56549e0b4d93c51b7d7b610782..aac64a7dc7c1f63d3b664b809245680faeef43d8 100644
--- a/base/build_time_unittest.cc
+++ b/base/build_time_unittest.cc
@@ -7,7 +7,11 @@
#include "testing/gtest/include/gtest/gtest.h"
TEST(BuildTime, DateLooksValid) {
+#if !defined(DONT_EMBED_BUILD_METADATA)
char build_date[] = __DATE__;
+#else
+ char build_date[] = "Sep 02 2008";
+#endif
EXPECT_EQ(11u, strlen(build_date));
EXPECT_EQ(' ', build_date[3]);
@@ -15,7 +19,11 @@ TEST(BuildTime, DateLooksValid) {
}
TEST(BuildTime, TimeLooksValid) {
+#if defined(DONT_EMBED_BUILD_METADATA)
+ char build_time[] = "08:00:00";
+#else
char build_time[] = __TIME__;
+#endif
EXPECT_EQ(8u, strlen(build_time));
EXPECT_EQ(':', build_time[2]);
« no previous file with comments | « base/build_time.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698