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

Side by Side Diff: webrtc/modules/video_capture/test/video_capture_unittest.cc

Issue 1530003004: Cleanup use of "do { ... } while (0)". (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 29 matching lines...) Expand all
40 40
41 41
42 #define WAIT_(ex, timeout, res) \ 42 #define WAIT_(ex, timeout, res) \
43 do { \ 43 do { \
44 res = (ex); \ 44 res = (ex); \
45 int64_t start = TickTime::MillisecondTimestamp(); \ 45 int64_t start = TickTime::MillisecondTimestamp(); \
46 while (!res && TickTime::MillisecondTimestamp() < start + timeout) { \ 46 while (!res && TickTime::MillisecondTimestamp() < start + timeout) { \
47 SleepMs(5); \ 47 SleepMs(5); \
48 res = (ex); \ 48 res = (ex); \
49 } \ 49 } \
50 } while (0);\ 50 } while (0)
51 51
52 #define EXPECT_TRUE_WAIT(ex, timeout) \ 52 #define EXPECT_TRUE_WAIT(ex, timeout) \
53 do { \ 53 do { \
54 bool res; \ 54 bool res; \
55 WAIT_(ex, timeout, res); \ 55 WAIT_(ex, timeout, res); \
56 if (!res) EXPECT_TRUE(ex); \ 56 if (!res) EXPECT_TRUE(ex); \
57 } while (0); 57 } while (0)
58 58
59 59
60 static const int kTimeOut = 5000; 60 static const int kTimeOut = 5000;
61 static const int kTestHeight = 288; 61 static const int kTestHeight = 288;
62 static const int kTestWidth = 352; 62 static const int kTestWidth = 352;
63 static const int kTestFramerate = 30; 63 static const int kTestFramerate = 30;
64 64
65 // Compares the content of two video frames. 65 // Compares the content of two video frames.
66 static bool CompareFrames(const webrtc::VideoFrame& frame1, 66 static bool CompareFrames(const webrtc::VideoFrame& frame1,
67 const webrtc::VideoFrame& frame2) { 67 const webrtc::VideoFrame& frame2) {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 length, capture_callback_.capability(), 0)); 531 length, capture_callback_.capability(), 0));
532 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); 532 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180));
533 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); 533 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180);
534 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), 534 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(),
535 length, capture_callback_.capability(), 0)); 535 length, capture_callback_.capability(), 0));
536 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); 536 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270));
537 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); 537 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270);
538 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), 538 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(),
539 length, capture_callback_.capability(), 0)); 539 length, capture_callback_.capability(), 0));
540 } 540 }
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698