removing the warnings from the voe tests.

Bug=http://code.google.com/p/webrtc/issues/detail?id=61
Test=None
Review URL: http://webrtc-codereview.appspot.com/139003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@475 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
xians@google.com 2011-08-29 07:30:16 +00:00
parent 2aa5d500af
commit c9b75e0a4b
4 changed files with 18 additions and 23 deletions

View File

@ -315,7 +315,7 @@ int ViEAutoTestMain::GetClassTestSelection()
{ {
int testType = 0; int testType = 0;
std::string answer; std::string answer;
int dummy = 0;
while (1) while (1)
{ {
ViETest::Log("Choose specific test: "); ViETest::Log("Choose specific test: ");
@ -337,7 +337,7 @@ int ViEAutoTestMain::GetClassTestSelection()
} }
else else
{ {
dummy = scanf("%d", &testType); scanf("%d", &testType);
getchar(); getchar();
} }
ViETest::Log("\n"); ViETest::Log("\n");

View File

@ -113,12 +113,11 @@ int VoEStressTest::MenuSelection()
const int maxMenuSelection = 4; const int maxMenuSelection = 4;
int selection(-1); int selection(-1);
int dummy(0);
while ((selection < 0) || (selection > maxMenuSelection)) while ((selection < 0) || (selection > maxMenuSelection))
{ {
printf("\n: "); printf("\n: ");
dummy = scanf("%d", &selection); scanf("%d", &selection);
if ((selection < 0) || (selection > maxMenuSelection)) if ((selection < 0) || (selection > maxMenuSelection))
{ {
printf("Invalid selection!\n"); printf("Invalid selection!\n");

View File

@ -277,12 +277,11 @@ int VoEUnitTest::MenuSelection()
const int maxMenuSelection = 2; const int maxMenuSelection = 2;
int selection(-1); int selection(-1);
int dummy(0);
while ((selection < 0) || (selection > maxMenuSelection)) while ((selection < 0) || (selection > maxMenuSelection))
{ {
printf("\n: "); printf("\n: ");
dummy = scanf("%d", &selection); scanf("%d", &selection);
if ((selection < 0) || (selection > maxMenuSelection)) if ((selection < 0) || (selection > maxMenuSelection))
{ {
printf("Invalid selection!\n"); printf("Invalid selection!\n");

View File

@ -45,7 +45,6 @@ using namespace webrtc;
{ \ { \
printf("*** Error at position %i / line %i \n", cnt, __LINE__); \ printf("*** Error at position %i / line %i \n", cnt, __LINE__); \
printf("*** Error code = %i \n", base1->LastError()); \ printf("*** Error code = %i \n", base1->LastError()); \
error = 1; \
} \ } \
cnt++; cnt++;
@ -93,7 +92,6 @@ my_transportation my_transport;
int main() { int main() {
int res = 0; int res = 0;
int cnt = 0; int cnt = 0;
int error = 0;
printf("Test started \n"); printf("Test started \n");
@ -189,7 +187,6 @@ void run_test() {
CodecInst cinst; CodecInst cinst;
cnt = 0; cnt = 0;
int i; int i;
int dummy(0);
int codecinput; int codecinput;
bool AEC = false; bool AEC = false;
bool AGC = true; bool AGC = true;
@ -222,12 +219,12 @@ void run_test() {
printf("1. 127.0.0.1 \n"); printf("1. 127.0.0.1 \n");
printf("2. Specify IP \n"); printf("2. Specify IP \n");
dummy = scanf("%i", &i); scanf("%i", &i);
if (1 == i) if (1 == i)
strcpy(ip, "127.0.0.1"); strcpy(ip, "127.0.0.1");
else { else {
printf("Specify remote IP: "); printf("Specify remote IP: ");
dummy = scanf("%s", ip); scanf("%s", ip);
} }
#endif #endif
@ -245,7 +242,7 @@ void run_test() {
rPort=8500; rPort=8500;
#else #else
printf("Specify remote port (1=1234): "); printf("Specify remote port (1=1234): ");
dummy = scanf("%i", &rPort); scanf("%i", &rPort);
if (1 == rPort) if (1 == rPort)
rPort = 1234; rPort = 1234;
printf("Set Send port \n"); printf("Set Send port \n");
@ -260,7 +257,7 @@ void run_test() {
lPort=8500; lPort=8500;
#else #else
printf("Specify local port (1=1234): "); printf("Specify local port (1=1234): ");
dummy = scanf("%i", &lPort); scanf("%i", &lPort);
if (1 == lPort) if (1 == lPort)
lPort = 1234; lPort = 1234;
printf("Set Rec Port \n"); printf("Set Rec Port \n");
@ -286,7 +283,7 @@ void run_test() {
codecinput=0; codecinput=0;
#else #else
printf("Select send codec: "); printf("Select send codec: ");
dummy = scanf("%i", &codecinput); scanf("%i", &codecinput);
#endif #endif
codec->GetCodec(codecinput, cinst); codec->GetCodec(codecinput, cinst);
@ -322,11 +319,11 @@ void run_test() {
} }
printf("Select playout device: "); printf("Select playout device: ");
dummy = scanf("%d", &pd); scanf("%d", &pd);
res = hardware->SetPlayoutDevice(pd); res = hardware->SetPlayoutDevice(pd);
VALIDATE; VALIDATE;
printf("Select recording device: "); printf("Select recording device: ");
dummy = scanf("%d", &rd); scanf("%d", &rd);
printf("Setting sound devices \n"); printf("Setting sound devices \n");
res = hardware->SetRecordingDevice(rd); res = hardware->SetRecordingDevice(rd);
VALIDATE; VALIDATE;
@ -351,7 +348,7 @@ void run_test() {
printf("2. Send only \n"); printf("2. Send only \n");
printf("3. Listen and playout only \n"); printf("3. Listen and playout only \n");
printf("Select transfer mode: "); printf("Select transfer mode: ");
dummy = scanf("%i", &i); scanf("%i", &i);
#endif #endif
const bool send = !(3 == i); const bool send = !(3 == i);
const bool receive = !(2 == i); const bool receive = !(2 == i);
@ -437,7 +434,7 @@ void run_test() {
printf("\t%i. Stop call \n", i); printf("\t%i. Stop call \n", i);
printf("Select action or %i to stop the call: ", i); printf("Select action or %i to stop the call: ", i);
dummy = scanf("%i", &codecinput); scanf("%i", &codecinput);
if (codecinput < codec->NumOfCodecs()) { if (codecinput < codec->NumOfCodecs()) {
res = codec->GetCodec(codecinput, cinst); res = codec->GetCodec(codecinput, cinst);
@ -509,7 +506,7 @@ void run_test() {
} }
else if (codecinput == (noCodecs + 8)) { else if (codecinput == (noCodecs + 8)) {
printf("Level: "); printf("Level: ");
dummy = scanf("%i", &i); scanf("%i", &i);
res = volume->SetSpeakerVolume(i); res = volume->SetSpeakerVolume(i);
VALIDATE; VALIDATE;
} }
@ -521,7 +518,7 @@ void run_test() {
} }
else if (codecinput == (noCodecs + 10)) { else if (codecinput == (noCodecs + 10)) {
printf("Level: "); printf("Level: ");
dummy = scanf("%i", &i); scanf("%i", &i);
res = volume->SetMicVolume(i); res = volume->SetMicVolume(i);
VALIDATE; VALIDATE;
} }
@ -544,7 +541,7 @@ void run_test() {
printf(" %d: %s \n", j, dn); printf(" %d: %s \n", j, dn);
} }
printf("Select playout device: "); printf("Select playout device: ");
dummy = scanf("%d", &num_pd); scanf("%d", &num_pd);
// Will use plughw for hardware devices // Will use plughw for hardware devices
res = hardware->SetPlayoutDevice(num_pd); res = hardware->SetPlayoutDevice(num_pd);
VALIDATE; VALIDATE;
@ -567,7 +564,7 @@ void run_test() {
} }
printf("Select recording device: "); printf("Select recording device: ");
dummy = scanf("%d", &num_rd); scanf("%d", &num_rd);
printf("Setting sound devices \n"); printf("Setting sound devices \n");
// Will use plughw for hardware devices // Will use plughw for hardware devices
res = hardware->SetRecordingDevice(num_rd); res = hardware->SetRecordingDevice(num_rd);
@ -625,7 +622,7 @@ void run_test() {
printf("\n1. New call \n"); printf("\n1. New call \n");
printf("2. Quit \n"); printf("2. Quit \n");
printf("Select action: "); printf("Select action: ");
dummy = scanf("%i", &i); scanf("%i", &i);
newcall = (1 == i); newcall = (1 == i);
// Call loop // Call loop
} }