From e0c2eeafaa188ce8be50d47255c71b27541f153e Mon Sep 17 00:00:00 2001 From: srte Date: Fri, 15 Dec 2017 17:44:33 +0100 Subject: [PATCH] Simplifying video engine test code. The macros confuses automatic tooling, Qt Creator fails to identify the tests defined with the special macros used before. The value for readers of defining the macros is not obvious either. Macros can sometime make code more compact and therefore quicker to overview. However they also increases ambiguity of the code and the reader will have to look up their definition to know what they do. In this case I argue that the slight decrease in code size does not outweigh the cost of lost tooling support. Bug: None Change-Id: Ic496fbe1fefdc5acd3f50ec99e2c804bb6065c3d Reviewed-on: https://webrtc-review.googlesource.com/33540 Commit-Queue: Sebastian Jansson Reviewed-by: Magnus Jedvert Cr-Commit-Position: refs/heads/master@{#21503} --- media/engine/webrtcvideoengine_unittest.cc | 76 +++++++++++++++------- 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/media/engine/webrtcvideoengine_unittest.cc b/media/engine/webrtcvideoengine_unittest.cc index 2f3a2d2060..3fe5ee5e7c 100644 --- a/media/engine/webrtcvideoengine_unittest.cc +++ b/media/engine/webrtcvideoengine_unittest.cc @@ -1139,40 +1139,66 @@ TEST_F(WebRtcVideoEngineTest, DISABLED_RecreatesEncoderOnContentTypeChange) { EXPECT_EQ(0u, encoder_factory_->encoders().size()); } -#define WEBRTC_BASE_TEST(test) \ - TEST_F(WebRtcVideoChannelBaseTest, test) { Base::test(); } +TEST_F(WebRtcVideoChannelBaseTest, SetSend) { + Base::SetSend(); +} +TEST_F(WebRtcVideoChannelBaseTest, SetSendWithoutCodecs) { + Base::SetSendWithoutCodecs(); +} +TEST_F(WebRtcVideoChannelBaseTest, SetSendSetsTransportBufferSizes) { + Base::SetSendSetsTransportBufferSizes(); +} -#define WEBRTC_DISABLED_BASE_TEST(test) \ - TEST_F(WebRtcVideoChannelBaseTest, DISABLED_##test) { Base::test(); } +TEST_F(WebRtcVideoChannelBaseTest, GetStats) { + Base::GetStats(); +} +TEST_F(WebRtcVideoChannelBaseTest, GetStatsMultipleRecvStreams) { + Base::GetStatsMultipleRecvStreams(); +} +TEST_F(WebRtcVideoChannelBaseTest, GetStatsMultipleSendStreams) { + Base::GetStatsMultipleSendStreams(); +} -WEBRTC_BASE_TEST(SetSend); -WEBRTC_BASE_TEST(SetSendWithoutCodecs); -WEBRTC_BASE_TEST(SetSendSetsTransportBufferSizes); +TEST_F(WebRtcVideoChannelBaseTest, SetSendBandwidth) { + Base::SetSendBandwidth(); +} -WEBRTC_BASE_TEST(GetStats); -WEBRTC_BASE_TEST(GetStatsMultipleRecvStreams); -WEBRTC_BASE_TEST(GetStatsMultipleSendStreams); +TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrc) { + Base::SetSendSsrc(); +} +TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrcAfterSetCodecs) { + Base::SetSendSsrcAfterSetCodecs(); +} -WEBRTC_BASE_TEST(SetSendBandwidth); +TEST_F(WebRtcVideoChannelBaseTest, SetSink) { + Base::SetSink(); +} -WEBRTC_BASE_TEST(SetSendSsrc); -WEBRTC_BASE_TEST(SetSendSsrcAfterSetCodecs); +TEST_F(WebRtcVideoChannelBaseTest, AddRemoveSendStreams) { + Base::AddRemoveSendStreams(); +} -WEBRTC_BASE_TEST(SetSink); +TEST_F(WebRtcVideoChannelBaseTest, SimulateConference) { + Base::SimulateConference(); +} -WEBRTC_BASE_TEST(AddRemoveSendStreams); +TEST_F(WebRtcVideoChannelBaseTest, DISABLED_AddRemoveCapturer) { + Base::AddRemoveCapturer(); +} -WEBRTC_BASE_TEST(SimulateConference); +TEST_F(WebRtcVideoChannelBaseTest, RemoveCapturerWithoutAdd) { + Base::RemoveCapturerWithoutAdd(); +} -WEBRTC_DISABLED_BASE_TEST(AddRemoveCapturer); - -WEBRTC_BASE_TEST(RemoveCapturerWithoutAdd); - -WEBRTC_BASE_TEST(AddRemoveCapturerMultipleSources); - -WEBRTC_BASE_TEST(RejectEmptyStreamParams); - -WEBRTC_BASE_TEST(MultipleSendStreams); +TEST_F(WebRtcVideoChannelBaseTest, AddRemoveCapturerMultipleSources) { + Base::AddRemoveCapturerMultipleSources(); +} +TEST_F(WebRtcVideoChannelBaseTest, RejectEmptyStreamParams) { + Base::RejectEmptyStreamParams(); +} +TEST_F(WebRtcVideoChannelBaseTest, MultipleSendStreams) { + Base::MultipleSendStreams(); +} TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8Vga) { SendAndReceive(GetEngineCodec("VP8"));