Fixed GCC 4.6 errors (mostly 'unused variable' errors and incorrect usage of EXPECT_EQ with booleans.

Fixed remaining compilation errors in release, etc.

Fixed errors from GCC 4.6 compilation.

BUG=
TEST=

Review URL: https://webrtc-codereview.appspot.com/366008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1554 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-01-26 14:49:28 +00:00
parent 42ae41e5a2
commit d1a860b415
15 changed files with 227 additions and 277 deletions

View File

@ -52,7 +52,6 @@ int main(int argc, char* argv[])
WebRtc_Word32 bottleneck;
WebRtc_Word16 framesize = 30; /* ms */
int cur_framesmpls, err;
int testCE=0;
/* Runtime statistics */
double starttime, runtime, length_file;
@ -73,7 +72,6 @@ int main(int argc, char* argv[])
int setControlBWE = 0;
short FL, testNum;
char version_number[20];
int readLoss;
FILE *plFile;
WebRtc_Word32 sendBN;
@ -86,7 +84,6 @@ int main(int argc, char* argv[])
/* If use GNS file */
FILE *fp_gns = NULL;
int gns = 0;
char gns_file[100];
short maxStreamLen30 = 0;
short maxStreamLen60 = 0;
@ -180,7 +177,6 @@ int main(int argc, char* argv[])
/* Loop over all command line arguments */
CodingMode = 0;
testNum = 0;
testCE = 0;
useAssign = 0;
//logFile = NULL;
char transCodingFileName[500];
@ -308,11 +304,9 @@ int main(int argc, char* argv[])
{
printf( "\nNo Packet Loss Is Simulated \n" );
}
readLoss = 0;
}
else
{
readLoss = 1;
plFile = fopen( argv[i+1], "rb" );
if( plFile == NULL )
{
@ -341,7 +335,6 @@ int main(int argc, char* argv[])
printf("Cannot read file %s.\n", gns_file);
exit(0);
}
gns = 1;
i++;
}
@ -642,8 +635,6 @@ int main(int argc, char* argv[])
cur_framesmpls = 0;
while (1)
{
int kkk;
/* Read 10 ms speech block */
endfile = readframe(shortdata, inp, samplesIn10Ms);
@ -681,7 +672,7 @@ int main(int argc, char* argv[])
cout << flush;
}
kkk = WebRtcIsac_GetUplinkBw(ISAC_main_inst, &sendBN);
WebRtcIsac_GetUplinkBw(ISAC_main_inst, &sendBN);
if(stream_len>0)
{
@ -723,7 +714,6 @@ int main(int argc, char* argv[])
}
else
{
kkk = 0;
break;
}

View File

@ -58,7 +58,6 @@ int main(int argc, char* argv[])
BottleNeckModel* packetData[MAX_NUM_CLIENTS];
char versionNumber[100];
short bottleneckChange[MAX_NUM_CLIENTS];
short samplesIn10ms[MAX_NUM_CLIENTS];
int bottleneck[MAX_NUM_CLIENTS];
@ -108,7 +107,6 @@ int main(int argc, char* argv[])
(encoderSampRate[clientCntr] == kIsacWideband)
? "wideband":"super-wideband");
bottleneckChange[clientCntr] = 2 * clientCntr - 1;
// Open output File Name
OPEN_FILE_WB(outFile[clientCntr], outFileName[clientCntr]);
printf("Output File...................... %s\n", outFileName[clientCntr]);

View File

@ -291,7 +291,6 @@ void EncodeDecodeTest::Perform() {
int numCodecs = 1;
int codePars[3]; //freq, pacsize, rate
int playoutFreq[3]; //8, 16, 32k
int numPars[52]; //number of codec parameters sets (rate,freq,pacsize)to test,
//for a given codec
@ -318,7 +317,6 @@ void EncodeDecodeTest::Perform() {
}
}
AudioCodingModule::Destroy(acmTmp);
playoutFreq[1] = 16000;
} else if (_testMode == 0) {
AudioCodingModule *acmTmp = AudioCodingModule::Create(0);
numCodecs = acmTmp->NumberOfCodecs();
@ -337,11 +335,9 @@ void EncodeDecodeTest::Perform() {
numPars[i] = 0;
}
}
playoutFreq[1] = 16000;
} else {
numCodecs = 1;
numPars[0] = 1;
playoutFreq[1]=16000;
}
_receiver.testMode = _testMode;

View File

@ -53,7 +53,6 @@ TestVADDTX::~TestVADDTX()
void TestVADDTX::Perform()
{
if(_testMode == 0)
{
printf("Running VAD/DTX Test");
@ -213,12 +212,15 @@ void TestVADDTX::runTestInternalDTX()
void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode)
{
WebRtc_Word32 status;
bool dtxEnabled, vadEnabled;
ACMVADMode vadModeSet;
status = _acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode);
status = _acmA->VAD(dtxEnabled, vadEnabled, vadModeSet);
if (_acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode) < 0) {
assert(false);
}
if (_acmA->VAD(dtxEnabled, vadEnabled, vadModeSet) < 0) {
assert(false);
}
if(_testMode != 0)
{
@ -256,11 +258,12 @@ void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode)
VADDTXstruct TestVADDTX::GetVAD()
{
VADDTXstruct retStruct;
WebRtc_Word32 status;
bool dtxEnabled, vadEnabled;
ACMVADMode vadModeSet;
status = _acmA->VAD(dtxEnabled, vadEnabled, vadModeSet);
if (_acmA->VAD(dtxEnabled, vadEnabled, vadModeSet) < 0) {
assert(false);
}
retStruct.statusDTX = dtxEnabled;
retStruct.statusVAD = vadEnabled;

View File

@ -77,7 +77,6 @@ int func_test(int sel)
TEST_LOG("- - - - - - - - - - - - - - - - - - - -\n");
TEST_LOG("\n: ");
int dummy(0);
int selection(0);
enum TestType testType(TTInvalid);
@ -89,7 +88,9 @@ SHOW_MENU:
}
else
{
dummy = scanf("%d", &selection);
if (scanf("%d", &selection) < 0) {
perror("Failed to get selection.");
}
}
switch (selection)

View File

@ -664,58 +664,56 @@ WebRtc_Word32 FuncTestManager::Close()
WebRtc_Word32 FuncTestManager::DoTest(const TestType testType)
{
WebRtc_UWord32 ret(0);
switch (testType)
{
case TTAll:
ret = TestAudioLayerSelection();
ret = TestDeviceEnumeration();
ret = TestDeviceSelection();
ret = TestAudioTransport();
ret = TestSpeakerVolume();
ret = TestMicrophoneVolume();
ret = TestLoopback();
TestAudioLayerSelection();
TestDeviceEnumeration();
TestDeviceSelection();
TestAudioTransport();
TestSpeakerVolume();
TestMicrophoneVolume();
TestLoopback();
case TTAudioLayerSelection:
TestAudioLayerSelection();
break;
case TTDeviceEnumeration:
ret = TestDeviceEnumeration();
TestDeviceEnumeration();
break;
case TTDeviceSelection:
ret = TestDeviceSelection();
TestDeviceSelection();
break;
case TTAudioTransport:
ret = TestAudioTransport();
TestAudioTransport();
break;
case TTSpeakerVolume:
ret = TestSpeakerVolume();
TestSpeakerVolume();
break;
case TTMicrophoneVolume:
ret = TestMicrophoneVolume();
TestMicrophoneVolume();
break;
case TTSpeakerMute:
ret = TestSpeakerMute();
TestSpeakerMute();
break;
case TTMicrophoneMute:
ret = TestMicrophoneMute();
TestMicrophoneMute();
break;
case TTMicrophoneBoost:
ret = TestMicrophoneBoost();
TestMicrophoneBoost();
break;
case TTMicrophoneAGC:
ret = TestMicrophoneAGC();
TestMicrophoneAGC();
break;
case TTLoopback:
ret = TestLoopback();
TestLoopback();
break;
case TTDeviceRemoval:
ret = TestDeviceRemoval();
TestDeviceRemoval();
break;
case TTMobileAPI:
ret = TestAdvancedMBAPI();
TestAdvancedMBAPI();
case TTTest:
ret = TestExtra();
TestExtra();
break;
default:
break;

View File

@ -88,11 +88,11 @@ void RtcpFormatRembTest::TearDown() {
}
TEST_F(RtcpFormatRembTest, TestBasicAPI) {
EXPECT_EQ(false, rtcp_sender_->REMB());
EXPECT_FALSE(rtcp_sender_->REMB());
EXPECT_EQ(0, rtcp_sender_->SetREMBStatus(true));
EXPECT_EQ(true, rtcp_sender_->REMB());
EXPECT_TRUE(rtcp_sender_->REMB());
EXPECT_EQ(0, rtcp_sender_->SetREMBStatus(false));
EXPECT_EQ(false, rtcp_sender_->REMB());
EXPECT_FALSE(rtcp_sender_->REMB());
EXPECT_EQ(0, rtcp_sender_->SetREMBData(1234, 0, NULL));
}

View File

@ -58,9 +58,9 @@ TEST_F(RtpRtcpAPITest, Basic) {
EXPECT_EQ(0, module->SetStartTimestamp(test_timestamp));
EXPECT_EQ(test_timestamp, module->StartTimestamp());
EXPECT_EQ(false, module->Sending());
EXPECT_FALSE(module->Sending());
EXPECT_EQ(0, module->SetSendingStatus(true));
EXPECT_EQ(true, module->Sending());
EXPECT_TRUE(module->Sending());
}
TEST_F(RtpRtcpAPITest, MTU) {
@ -108,11 +108,11 @@ TEST_F(RtpRtcpAPITest, RTCP) {
EXPECT_STRCASEEQ(cName, "john.doe@test.test");
EXPECT_EQ(-1, module->CNAME(NULL));
EXPECT_EQ(false, module->TMMBR());
EXPECT_FALSE(module->TMMBR());
EXPECT_EQ(0, module->SetTMMBRStatus(true));
EXPECT_EQ(true, module->TMMBR());
EXPECT_TRUE(module->TMMBR());
EXPECT_EQ(0, module->SetTMMBRStatus(false));
EXPECT_EQ(false, module->TMMBR());
EXPECT_FALSE(module->TMMBR());
EXPECT_EQ(kNackOff, module->NACK());
EXPECT_EQ(0, module->SetNACKStatus(kNackRtcp));

View File

@ -65,7 +65,7 @@ class VerifyingAudioReceiver : public RtpData {
return 0;
}
}
EXPECT_EQ(false, true) << "This code path should never happen.";
ADD_FAILURE() << "This code path should never happen.";
return -1;
}
return 0;
@ -192,7 +192,7 @@ TEST_F(RtpRtcpAudioTest, Basic) {
EXPECT_EQ(0, module1->SetSSRC(test_ssrc));
EXPECT_EQ(0, module1->SetStartTimestamp(test_timestamp));
EXPECT_EQ(false, module1->TelephoneEvent());
EXPECT_FALSE(module1->TelephoneEvent());
// Test detection at the end of a DTMF tone.
EXPECT_EQ(0, module2->SetTelephoneEventStatus(true, true, true));

View File

@ -145,7 +145,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
FillPacket(0);
ASSERT_EQ(kPacketBufferSize,
session_.InsertPacket(packet_, frame_buffer_, false, 0));
EXPECT_EQ(false, session_.HaveLastPacket());
EXPECT_FALSE(session_.HaveLastPacket());
EXPECT_EQ(kVideoFrameKey, session_.FrameType());
packet_.isFirstPacket = false;
@ -153,7 +153,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
packet_.seqNum += 1;
ASSERT_EQ(kPacketBufferSize,
session_.InsertPacket(packet_, frame_buffer_, false, 0));
EXPECT_EQ(true, session_.HaveLastPacket());
EXPECT_TRUE(session_.HaveLastPacket());
EXPECT_EQ(packet_.seqNum, session_.HighSequenceNumber());
EXPECT_EQ(0xFFFE, session_.LowSequenceNumber());
@ -804,7 +804,7 @@ TEST_F(TestNackList, NoLosses) {
EXPECT_EQ(10 * kPacketBufferSize, session_.SessionLength());
BuildSeqNumList(low, packet_.seqNum);
EXPECT_EQ(0, session_.BuildHardNackList(seq_num_list_, seq_num_list_length_));
EXPECT_EQ(false, session_.session_nack());
EXPECT_FALSE(session_.session_nack());
SCOPED_TRACE("Calling VerifyAll");
VerifyAll(-1);

View File

@ -275,7 +275,6 @@ GenericCodecTest::Perform(CmdArgs& args)
const float nBitrates = sizeof(bitRate)/sizeof(*bitRate);
float _bitRate = 0;
int _frameCnt = 0;
WebRtc_Word64 startTime, currentTime, oneSecTime;
float totalBytesOneSec;//, totalBytesTenSec;
float totalBytes, actualBitrate;
VCMFrameCount frameCount; // testing frame type counters
@ -309,7 +308,6 @@ GenericCodecTest::Perform(CmdArgs& args)
_vcm->SetChannelParameters((WebRtc_UWord32)_bitRate, 0, 20);
_frameCnt = 0;
totalBytes = 0;
startTime = _clock->MicrosecondTimestamp();
_encodeCompleteCallback->Initialize();
sendStats.SetTargetFrameRate(static_cast<WebRtc_UWord32>(_frameRate));
_vcm->RegisterSendStatisticsCallback(&sendStats);
@ -333,7 +331,6 @@ GenericCodecTest::Perform(CmdArgs& args)
//currentTime = VCMTickTime::MillisecondTimestamp();//clock()/(double)CLOCKS_PER_SEC;
if (_frameCnt == _frameRate)// @ 1sec
{
oneSecTime = _clock->MicrosecondTimestamp();
totalBytesOneSec = _encodeCompleteCallback->EncodedBytes();//totalBytes;
}
TEST(_vcm->TimeUntilNextProcess() >= 0);
@ -343,7 +340,6 @@ GenericCodecTest::Perform(CmdArgs& args)
// estimating rates
// complete sequence
// bit rate assumes input frame rate is as specified
currentTime = _clock->MicrosecondTimestamp();
totalBytes = _encodeCompleteCallback->EncodedBytes();
actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate));
@ -367,7 +363,6 @@ GenericCodecTest::Perform(CmdArgs& args)
/********************************/
/* Encoder Pipeline Delay Test */
/******************************/
WebRtc_Word32 retVal;
_vcm->InitializeSender();
sourceFrame.Free();
sourceFrame.VerifyAndAllocate(_lengthSourceFrame);
@ -376,11 +371,11 @@ GenericCodecTest::Perform(CmdArgs& args)
// going over all available codecs
for (int k = 0; k < NumberOfCodecs; k++)
{
retVal = _vcm->Codec(k, &_sendCodec);
retVal = _vcm->InitializeSender();
_vcm->Codec(k, &_sendCodec);
_vcm->InitializeSender();
_sendCodec.maxBitrate = 8000;
retVal = _vcm->RegisterSendCodec(&_sendCodec, 4, 1440);
retVal = _vcm->RegisterTransportCallback(_encodeCompleteCallback);
_vcm->RegisterSendCodec(&_sendCodec, 4, 1440);
_vcm->RegisterTransportCallback(_encodeCompleteCallback);
_frameCnt = 0;
encodeComplete = false;
@ -393,7 +388,7 @@ GenericCodecTest::Perform(CmdArgs& args)
sourceFrame.SetWidth(_width);
_timeStamp += (WebRtc_UWord32)(9e4 / static_cast<float>(_frameRate));
sourceFrame.SetTimeStamp(_timeStamp);
retVal = _vcm->AddVideoFrame(sourceFrame);
_vcm->AddVideoFrame(sourceFrame);
encodeComplete = _encodeCompleteCallback->EncodeComplete();
} // first frame encoded
printf ("\n Codec type = %s \n", _sendCodec.plName);

View File

@ -470,40 +470,6 @@ VCMQMDecodeCompleCallback::SetOriginalFrameDimensions(WebRtc_Word32 width, WebRt
WebRtc_Word32
VCMQMDecodeCompleCallback::buildInterpolator()
{
// if (_interpolator != NULL)
// {
// deleteInterpolator(_interpolator);
// _interpolator = NULL;
// }
// create decimator
WebRtc_Word32 filterPar = 4; //Lanczos (assuming sampling ratio is 1, 1.5, 2, 4)
float HeightRatio = 0;
float WidthRatio = 0;
WidthRatio = (float)_origWidth/(float)_decWidth;
HeightRatio = (float)_origHeight/(float)_decHeight;
if ( (HeightRatio == 1.0 || HeightRatio == 1.5 || HeightRatio == 2 || HeightRatio == 4) &&
(WidthRatio == 1.0 || WidthRatio == 1.5 || WidthRatio == 2 || WidthRatio == 4))
{
filterPar = 4; //Lanczos
} else
{
filterPar = 0; //BiCubic
}
// define interpolator here
// create interpolator here
// if (_interpolator == NULL)
// {
// return -1;
// }
WebRtc_UWord32 decFrameLength = _origWidth*_origHeight*3 >> 1;
if (_decBuffer != NULL)
{

View File

@ -67,7 +67,6 @@ int ReceiverTimingTests(CmdArgs& args)
WebRtc_UWord32 waitTime = 0;
WebRtc_UWord32 jitterDelayMs = 0;
WebRtc_UWord32 maxDecodeTimeMs = 0;
WebRtc_UWord32 extraDelayMs = 0;
WebRtc_UWord32 timeStamp = 0;
timing.Reset(static_cast<WebRtc_Word64>(clockInMs + 0.5));
@ -170,7 +169,6 @@ int ReceiverTimingTests(CmdArgs& args)
jitterDelayMs = 60;
maxDecodeTimeMs = 10;
extraDelayMs = 0;
timeStamp = static_cast<WebRtc_UWord32>(-10000); // To produce a wrap
clockInMs = 10000.0f;

View File

@ -204,9 +204,9 @@ TEST_F(VideoProcessingModuleTest, FrameStats)
ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength,
_sourceFile));
EXPECT_EQ(false, _vpm->ValidFrameStats(stats));
EXPECT_FALSE(_vpm->ValidFrameStats(stats));
EXPECT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
EXPECT_EQ(true, _vpm->ValidFrameStats(stats));
EXPECT_TRUE(_vpm->ValidFrameStats(stats));
printf("\nFrameStats\n");
printf("mean: %u\nnumPixels: %u\nsubSamplWidth: "
@ -218,7 +218,7 @@ TEST_F(VideoProcessingModuleTest, FrameStats)
static_cast<unsigned int>(stats.sum));
_vpm->ClearFrameStats(stats);
EXPECT_EQ(false, _vpm->ValidFrameStats(stats));
EXPECT_FALSE(_vpm->ValidFrameStats(stats));
}
TEST_F(VideoProcessingModuleTest, PreprocessorLogic)

View File

@ -336,7 +336,12 @@ int TestSingleStream(VideoRender* renderModule) {
printf("Start render\n");
error = renderModule->StartRender(streamId0);
assert(error == 0);
if (error != 0) {
// TODO(phoglund): This test will not work if compiled in release mode.
// This rather silly construct here is to avoid compilation errors when
// compiling in release. Release => no asserts => unused 'error' variable.
assert(false);
}
// Loop through an I420 file and render each frame
const WebRtc_UWord32 width = 352;