OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/build_time.h" | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 TEST(BuildTime, DateLooksValid) { | |
10 char build_date[] = __DATE__; | |
11 | |
12 EXPECT_EQ(11u, strlen(build_date)); | |
13 EXPECT_EQ(' ', build_date[3]); | |
14 EXPECT_EQ(' ', build_date[6]); | |
15 } | |
16 | |
17 TEST(BuildTime, TimeLooksValid) { | |
18 char build_time[] = __TIME__; | |
19 | |
20 EXPECT_EQ(8u, strlen(build_time)); | |
21 EXPECT_EQ(':', build_time[2]); | |
22 EXPECT_EQ(':', build_time[5]); | |
23 } | |
24 | |
25 TEST(BuildTime, DoesntCrash) { | |
26 // Since __DATE__ isn't updated unless one does a clobber build, we can't | |
27 // really test the value returned by it, except to check that it doesn't | |
28 // crash. | |
29 base::GetBuildTime(); | |
jar (doing other things)
2011/11/09 22:51:31
You could compare to Now(), and it should always b
agl
2011/11/10 19:02:58
I don't think that we can do that. I've set the ti
jar (doing other things)
2011/11/11 02:48:35
Maybe it is too much of a hassle.... but you can g
| |
30 } | |
OLD | NEW |