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

Side by Side Diff: testing/gtest-support.h

Issue 591373003: Move test for reduction of Math.imul to unittest. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Benedikt. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TESTING_GTEST_SUPPORT_H_ 5 #ifndef V8_TESTING_GTEST_SUPPORT_H_
6 #define V8_TESTING_GTEST_SUPPORT_H_ 6 #define V8_TESTING_GTEST_SUPPORT_H_
7 7
8 #include "include/v8stdint.h" 8 #include "include/v8stdint.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 18 matching lines...) Expand all
29 #undef GET_TYPE_NAME 29 #undef GET_TYPE_NAME
30 30
31 31
32 // TRACED_FOREACH(type, var, array) expands to a loop that assigns |var| every 32 // TRACED_FOREACH(type, var, array) expands to a loop that assigns |var| every
33 // item in the |array| and adds a SCOPED_TRACE() message for the |var| while 33 // item in the |array| and adds a SCOPED_TRACE() message for the |var| while
34 // inside the loop body. 34 // inside the loop body.
35 // TODO(bmeurer): Migrate to C++11 once we're ready. 35 // TODO(bmeurer): Migrate to C++11 once we're ready.
36 #define TRACED_FOREACH(_type, _var, _array) \ 36 #define TRACED_FOREACH(_type, _var, _array) \
37 for (size_t _i = 0; _i < arraysize(_array); ++_i) \ 37 for (size_t _i = 0; _i < arraysize(_array); ++_i) \
38 for (bool _done = false; !_done;) \ 38 for (bool _done = false; !_done;) \
39 for (const _type _var = _array[_i]; !_done;) \ 39 for (_type const _var = _array[_i]; !_done;) \
40 for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \ 40 for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \
41 !_done; _done = true) 41 !_done; _done = true)
42 42
43 43
44 // TRACED_FORRANGE(type, var, low, high) expands to a loop that assigns |var| 44 // TRACED_FORRANGE(type, var, low, high) expands to a loop that assigns |var|
45 // every value in the range |low| to (including) |high| and adds a 45 // every value in the range |low| to (including) |high| and adds a
46 // SCOPED_TRACE() message for the |var| while inside the loop body. 46 // SCOPED_TRACE() message for the |var| while inside the loop body.
47 // TODO(bmeurer): Migrate to C++11 once we're ready. 47 // TODO(bmeurer): Migrate to C++11 once we're ready.
48 #define TRACED_FORRANGE(_type, _var, _low, _high) \ 48 #define TRACED_FORRANGE(_type, _var, _low, _high) \
49 for (_type _i = _low; _i <= _high; ++_i) \ 49 for (_type _i = _low; _i <= _high; ++_i) \
50 for (bool _done = false; !_done;) \ 50 for (bool _done = false; !_done;) \
51 for (const _type _var = _i; !_done;) \ 51 for (_type const _var = _i; !_done;) \
52 for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \ 52 for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \
53 !_done; _done = true) 53 !_done; _done = true)
54 54
55 } // namespace internal 55 } // namespace internal
56 } // namespace testing 56 } // namespace testing
57 57
58 #endif // V8_TESTING_GTEST_SUPPORT_H_ 58 #endif // V8_TESTING_GTEST_SUPPORT_H_
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698