Index: testing/gtest-support.h |
diff --git a/testing/gtest-support.h b/testing/gtest-support.h |
index 04daa55edcf211dbba01a6e01aef03ee6e8d773f..ba0e2f41f993bd1873d15460226e8f527f9fa1a2 100644 |
--- a/testing/gtest-support.h |
+++ b/testing/gtest-support.h |
@@ -5,7 +5,6 @@ |
#ifndef V8_TESTING_GTEST_SUPPORT_H_ |
#define V8_TESTING_GTEST_SUPPORT_H_ |
-#include <stddef.h> |
#include "testing/gtest/include/gtest/gtest.h" |
namespace testing { |
@@ -32,16 +31,14 @@ GET_TYPE_NAME(double) |
#undef GET_TYPE_NAME |
-// TRACED_FOREACH(type, var, array) expands to a loop that assigns |var| every |
-// item in the |array| and adds a SCOPED_TRACE() message for the |var| while |
-// inside the loop body. |
-// TODO(bmeurer): Migrate to C++11 once we're ready. |
-#define TRACED_FOREACH(_type, _var, _array) \ |
- for (size_t _i = 0; _i < arraysize(_array); ++_i) \ |
- for (bool _done = false; !_done;) \ |
- for (_type const _var = _array[_i]; !_done;) \ |
- for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \ |
- !_done; _done = true) |
+// TRACED_FOREACH(type, var, container) expands to a loop that assigns |var| |
+// every item in the |container| and adds a SCOPED_TRACE() message for the |
+// |var| while inside the loop body. |
+#define TRACED_FOREACH(_type, _var, _container) \ |
+ for (_type const _var : _container) \ |
Sven Panne
2015/01/16 08:30:38
I know that this is the literal translation (more
|
+ for (bool _done = false; !_done;) \ |
+ for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \ |
+ !_done; _done = true) |
// TRACED_FORRANGE(type, var, low, high) expands to a loop that assigns |var| |