Index: net/base/build_time_unittest.cc |
diff --git a/net/base/build_time_unittest.cc b/net/base/build_time_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..08443f2345725a993cf010009a123ba0d7eb9695 |
--- /dev/null |
+++ b/net/base/build_time_unittest.cc |
@@ -0,0 +1,20 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "net/base/build_time.h" |
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+TEST(BuildTime, DateFormat) { |
+ char build_date[] = __DATE__; |
+ |
+ EXPECT_EQ(11u, strlen(build_date)); |
+ EXPECT_EQ(' ', build_date[3]); |
+ EXPECT_EQ(' ', build_date[6]); |
+ |
+ // Since __DATE__ isn't updated unless one does a clobber build, we can't |
+ // really test the value returned by it, except to check that it doesn't |
+ // crash. |
+ net::GetDaysSinceBuild(); |
+} |