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 <srte@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21503}
This commit is contained in:
srte 2017-12-15 17:44:33 +01:00 committed by Commit Bot
parent b960e4193e
commit e0c2eeafaa

View File

@ -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"));