Bug 1320891 - Make some webrtc tests build with gcc 7.0 and --enable-warnings-as-errors r=bwc
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 29 Nov 2016 11:03:20 +0100
changeset 324673 918309d4aea0210855b4b531452b2b8182a9c501
parent 324672 3a64450cc56a11645148cf396768e0bc56c90953
child 324674 69842f0e5150f11849fe37773e8a15abc9a496e6
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbwc
bugs1320891
milestone53.0a1
Bug 1320891 - Make some webrtc tests build with gcc 7.0 and --enable-warnings-as-errors r=bwc MozReview-Commit-ID: 6autz34In8Z
media/webrtc/signaling/test/mediaconduit_unittests.cpp
media/webrtc/signaling/test/signaling_unittests.cpp
--- a/media/webrtc/signaling/test/mediaconduit_unittests.cpp
+++ b/media/webrtc/signaling/test/mediaconduit_unittests.cpp
@@ -545,24 +545,26 @@ class TransportConduitTest : public ::te
   //1. Dump audio samples to dummy external transport
   void TestDummyAudioAndTransport()
   {
     //get pointer to AudioSessionConduit
     int err=0;
     mozilla::SyncRunnable::DispatchToThread(gMainThread,
                                             WrapRunnableNMRet(&mAudioSession,
                                                 &mozilla::AudioSessionConduit::Create));
-    if( !mAudioSession )
+    if( !mAudioSession ) {
       ASSERT_NE(mAudioSession, (void*)nullptr);
+    }
 
     mozilla::SyncRunnable::DispatchToThread(gMainThread,
                                             WrapRunnableNMRet(&mAudioSession2,
                                                 &mozilla::AudioSessionConduit::Create));
-    if( !mAudioSession2 )
+    if( !mAudioSession2 ) {
       ASSERT_NE(mAudioSession2, (void*)nullptr);
+    }
 
     WebrtcMediaTransport* xport = new WebrtcMediaTransport();
     ASSERT_NE(xport, (void*)nullptr);
     xport->SetAudioSession(mAudioSession, mAudioSession2);
     mAudioTransport = xport;
 
     // attach the transport to audio-conduit
     err = mAudioSession->SetTransmitterTransport(mAudioTransport);
@@ -610,25 +612,27 @@ class TransportConduitTest : public ::te
   //2. Dump audio samples to dummy external transport
   void TestDummyVideoAndTransport(bool send_vp8 = true, const char *source_file = nullptr)
   {
     int err = 0;
     //get pointer to VideoSessionConduit
     mozilla::SyncRunnable::DispatchToThread(gMainThread,
                                             WrapRunnableNMRet(&mVideoSession,
                                                 &mozilla::VideoSessionConduit::Create));
-    if( !mVideoSession )
+    if( !mVideoSession ) {
       ASSERT_NE(mVideoSession, (void*)nullptr);
+   }
 
    // This session is for other one
     mozilla::SyncRunnable::DispatchToThread(gMainThread,
                                             WrapRunnableNMRet(&mVideoSession2,
                                                 &mozilla::VideoSessionConduit::Create));
-    if( !mVideoSession2 )
+    if( !mVideoSession2 ) {
       ASSERT_NE(mVideoSession2,(void*)nullptr);
+    }
 
     if (!send_vp8) {
       SetGmpCodecs();
     }
 
     mVideoRenderer = new DummyVideoTarget();
     ASSERT_NE(mVideoRenderer, (void*)nullptr);
 
@@ -711,18 +715,19 @@ class TransportConduitTest : public ::te
  void TestVideoConduitCodecAPI()
   {
     int err = 0;
     RefPtr<mozilla::VideoSessionConduit> videoSession;
     //get pointer to VideoSessionConduit
     mozilla::SyncRunnable::DispatchToThread(gMainThread,
                                             WrapRunnableNMRet(&videoSession,
                                                 &mozilla::VideoSessionConduit::Create));
-    if( !videoSession )
+    if( !videoSession ) {
       ASSERT_NE(videoSession, (void*)nullptr);
+    }
 
     //Test Configure Recv Codec APIS
     cerr << "   *************************************************" << endl;
     cerr << "    Test Receive Codec Configuration API Now " << endl;
     cerr << "   *************************************************" << endl;
 
     std::vector<mozilla::VideoCodecConfig* > rcvCodecList;
 
@@ -826,18 +831,19 @@ class TransportConduitTest : public ::te
                                    int *new_width, int *new_height)
   {
     int err = 0;
 
     // Get pointer to VideoSessionConduit.
     mozilla::SyncRunnable::DispatchToThread(gMainThread,
                                             WrapRunnableNMRet(&mVideoSession,
                                                 &mozilla::VideoSessionConduit::Create));
-    if( !mVideoSession )
+    if( !mVideoSession ) {
       ASSERT_NE(mVideoSession, (void*)nullptr);
+    }
 
     mozilla::EncodingConstraints constraints;
     constraints.maxFs = max_fs;
     // Configure send codecs on the conduit.
     mozilla::VideoCodecConfig cinst1(120, "VP8", constraints);
 
     err = mVideoSession->ConfigureSendMediaCodec(&cinst1);
     ASSERT_EQ(mozilla::kMediaConduitNoError, err);
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -1470,18 +1470,18 @@ class SignalingAgent {
   }
 
   void AddIceCandidate(const std::string& candidate, const std::string& mid, unsigned short level,
                        bool expectSuccess) {
     PCImplSignalingState endState = signaling_state();
     pObserver->addIceCandidateState = TestObserver::stateNoResponse;
     pc->AddIceCandidate(candidate.c_str(), mid.c_str(), level);
     ASSERT_TRUE(pObserver->addIceCandidateState ==
-                expectSuccess ? TestObserver::stateSuccess :
-                                TestObserver::stateError
+                (expectSuccess ? TestObserver::stateSuccess :
+                                TestObserver::stateError)
                );
 
     // Verify that adding ICE candidates does not change the signaling state
     ASSERT_EQ(signaling_state(), endState);
     ASSERT_NE("", mid);
   }
 
   int GetPacketsReceived(const std::string& streamId) const