Fix "ignoring return value" in ViE tests.
Review URL: http://webrtc-codereview.appspot.com/133016 git-svn-id: http://webrtc.googlecode.com/svn/trunk@538 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -153,7 +153,11 @@ int VideoEngineSampleCode(void* window1, void* window2)
|
|||||||
captureIdx = 0;
|
captureIdx = 0;
|
||||||
printf("0\n");
|
printf("0\n");
|
||||||
#else
|
#else
|
||||||
scanf("%d", &captureIdx);
|
if (scanf("%d", &captureIdx) != 1)
|
||||||
|
{
|
||||||
|
printf("Error in scanf()\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
getchar();
|
getchar();
|
||||||
captureIdx = captureIdx - 1; // Compensate for idx start at 1.
|
captureIdx = captureIdx - 1; // Compensate for idx start at 1.
|
||||||
#endif
|
#endif
|
||||||
@ -311,7 +315,11 @@ int VideoEngineSampleCode(void* window1, void* window2)
|
|||||||
codecIdx = 0;
|
codecIdx = 0;
|
||||||
printf("0\n");
|
printf("0\n");
|
||||||
#else
|
#else
|
||||||
scanf("%d", &codecIdx);
|
if (scanf("%d", &codecIdx) != 1)
|
||||||
|
{
|
||||||
|
printf("Error in scanf()\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
getchar();
|
getchar();
|
||||||
codecIdx = codecIdx - 1; // Compensate for idx start at 1.
|
codecIdx = codecIdx - 1; // Compensate for idx start at 1.
|
||||||
#endif
|
#endif
|
||||||
|
@ -331,17 +331,18 @@ int ViEAutoTestMain::GetClassTestSelection()
|
|||||||
ViETest::Log("\t 11. Go back to previous menu");
|
ViETest::Log("\t 11. Go back to previous menu");
|
||||||
ViETest::Log("Select type of test: ");
|
ViETest::Log("Select type of test: ");
|
||||||
|
|
||||||
|
int items_read = 0;
|
||||||
if (_useAnswerFile)
|
if (_useAnswerFile)
|
||||||
{
|
{
|
||||||
//GetNextAnswer(answer);
|
//GetNextAnswer(answer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scanf("%d", &testType);
|
items_read = scanf("%d", &testType);
|
||||||
getchar();
|
getchar();
|
||||||
}
|
}
|
||||||
ViETest::Log("\n");
|
ViETest::Log("\n");
|
||||||
if (testType >= 1 && testType <= 13)
|
if (items_read == 1 && testType >= 1 && testType <= 13)
|
||||||
{
|
{
|
||||||
return testType;
|
return testType;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user