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

Unified Diff: base/location_unittest.cc

Issue 2399053004: Move GetProgramCounter in FROM_HERE to a common function (Closed)
Patch Set: -BASE_EXPORT Created 4 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/location.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/location_unittest.cc
diff --git a/base/location_unittest.cc b/base/location_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..277a411f0729dd29af1ff2cfeff0c3c41ff66982
--- /dev/null
+++ b/base/location_unittest.cc
@@ -0,0 +1,24 @@
+// Copyright 2016 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 "base/location.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace tracked_objects {
+
+#if defined(COMPILER_MSVC) || (defined(COMPILER_GCC) && !defined(OS_NACL))
+TEST(LocationTest, TestProgramCounter) {
+ Location loc1 = FROM_HERE;
+ const void* pc1 = GetProgramCounter();
+ const void* pc2 = GetProgramCounter();
+ Location loc2 = FROM_HERE;
+
+ EXPECT_LT(loc1.program_counter(), pc1);
+ EXPECT_LT(pc1, pc2);
+ EXPECT_LT(pc2, loc2.program_counter());
+}
+#endif // defined(COMPILER_MSVC) || (defined(COMPILER_GCC) && !defined(OS_NACL))
+
+} // namespace base
« no previous file with comments | « base/location.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698