OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 if (!res) EXPECT_TRUE(ex); \ | 45 if (!res) EXPECT_TRUE(ex); \ |
46 } while (0); | 46 } while (0); |
47 | 47 |
48 #define EXPECT_EQ_WAIT(v1, v2, timeout) \ | 48 #define EXPECT_EQ_WAIT(v1, v2, timeout) \ |
49 do { \ | 49 do { \ |
50 bool res; \ | 50 bool res; \ |
51 WAIT_(v1 == v2, timeout, res); \ | 51 WAIT_(v1 == v2, timeout, res); \ |
52 if (!res) EXPECT_EQ(v1, v2); \ | 52 if (!res) EXPECT_EQ(v1, v2); \ |
53 } while (0); | 53 } while (0); |
54 | 54 |
| 55 #define EXPECT_GT_WAIT(v1, v2, timeout) \ |
| 56 do { \ |
| 57 bool res; \ |
| 58 WAIT_(v1 > v2, timeout, res); \ |
| 59 if (!res) \ |
| 60 EXPECT_GT(v1, v2); \ |
| 61 } while (0); |
| 62 |
55 #define ASSERT_TRUE_WAIT(ex, timeout) \ | 63 #define ASSERT_TRUE_WAIT(ex, timeout) \ |
56 do { \ | 64 do { \ |
57 bool res; \ | 65 bool res; \ |
58 WAIT_(ex, timeout, res); \ | 66 WAIT_(ex, timeout, res); \ |
59 if (!res) ASSERT_TRUE(ex); \ | 67 if (!res) ASSERT_TRUE(ex); \ |
60 } while (0); | 68 } while (0); |
61 | 69 |
62 #define ASSERT_EQ_WAIT(v1, v2, timeout) \ | 70 #define ASSERT_EQ_WAIT(v1, v2, timeout) \ |
63 do { \ | 71 do { \ |
64 bool res; \ | 72 bool res; \ |
(...skipping 13 matching lines...) Expand all Loading... |
78 } \ | 86 } \ |
79 LOG(LS_WARNING) << "Expression " << #ex << " still not true after " << \ | 87 LOG(LS_WARNING) << "Expression " << #ex << " still not true after " << \ |
80 timeout << "ms; waiting an additional " << margin << "ms"; \ | 88 timeout << "ms; waiting an additional " << margin << "ms"; \ |
81 WAIT_(ex, margin, res); \ | 89 WAIT_(ex, margin, res); \ |
82 if (!res) { \ | 90 if (!res) { \ |
83 EXPECT_TRUE(ex); \ | 91 EXPECT_TRUE(ex); \ |
84 } \ | 92 } \ |
85 } while (0); | 93 } while (0); |
86 | 94 |
87 #endif // WEBRTC_BASE_GUNIT_H_ | 95 #endif // WEBRTC_BASE_GUNIT_H_ |
OLD | NEW |