Index: util/win/time_test.cc |
diff --git a/util/test/executable_path_win.cc b/util/win/time_test.cc |
similarity index 69% |
copy from util/test/executable_path_win.cc |
copy to util/win/time_test.cc |
index 024478d7552d5a0a3cdb03e5f686d193549b2ee3..ad0771e38b7889ab92154490845a0c3aafe13782 100644 |
--- a/util/test/executable_path_win.cc |
+++ b/util/win/time_test.cc |
@@ -12,18 +12,23 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include "util/test/executable_path.h" |
+#include "util/win/time.h" |
-#include <windows.h> |
+#include "gtest/gtest.h" |
namespace crashpad { |
namespace test { |
+namespace { |
-base::FilePath ExecutablePath() { |
- wchar_t executable_path[_MAX_PATH]; |
- GetModuleFileName(nullptr, executable_path, sizeof(executable_path)); |
- return base::FilePath(executable_path); |
+TEST(Time, Reasonable) { |
+ timeval t; |
+ GetTimeOfDay(&t); |
+ // Assume that time's time_t return is seconds from 1970. |
+ time_t approx_now = time(nullptr); |
+ EXPECT_GE(approx_now, t.tv_sec); |
+ EXPECT_LT(approx_now - 100, t.tv_sec); |
} |
+} // namespace |
} // namespace test |
} // namespace crashpad |