From a3f30143b7065d08721df7ea9b4dc311cb013567 Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Wed, 17 Jul 2013 14:25:45 +0000 Subject: [PATCH] Default constructor for RtcpAppHandler. Whenever this test (RtcpApplicationDefinedPacketsCanBeSentAndReceived) fails because it's being run on a slower system (such as one running under valgrind), valgrind reports a lot of undefined-value errors. Initializing the data makes sure that, while the EXPECT_EQs trigger, they don't cause any errors in valgrind. BUG= R=xians@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1822004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4363 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc b/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc index 810cb140f7..370fbaaff6 100644 --- a/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc @@ -78,6 +78,7 @@ void TestRtpObserver::OnIncomingSSRCChanged(int channel, class RtcpAppHandler : public webrtc::VoERTCPObserver { public: + RtcpAppHandler() : length_in_bytes_(0), sub_type_(0), name_(0) {} void OnApplicationDataReceived(int channel, unsigned char sub_type, unsigned int name, @@ -190,7 +191,7 @@ TEST_F(RtpRtcpTest, RtcpApplicationDefinedPacketsCanBeSentAndReceived) { Sleep(1000); // Ensure we received the data in the callback. - EXPECT_EQ(data_length, rtcp_app_handler.length_in_bytes_); + ASSERT_EQ(data_length, rtcp_app_handler.length_in_bytes_); EXPECT_EQ(0, memcmp(data, rtcp_app_handler.data_, data_length)); EXPECT_EQ(data_name, rtcp_app_handler.name_); EXPECT_EQ(data_subtype, rtcp_app_handler.sub_type_);