Fix Release mode errors in common_video tests.

Review URL: http://webrtc-codereview.appspot.com/271001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@891 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2011-11-04 23:59:56 +00:00
parent a5c4c1f1d4
commit 369766ed29
3 changed files with 13 additions and 7 deletions

View File

@ -49,7 +49,7 @@ main(int argc, char **argv)
// Get file length // Get file length
fseek(openFile, 0, SEEK_END); fseek(openFile, 0, SEEK_END);
int length = ftell(openFile); size_t length = ftell(openFile);
fseek(openFile, 0, SEEK_SET); fseek(openFile, 0, SEEK_SET);
@ -58,7 +58,11 @@ main(int argc, char **argv)
encodedBuffer._buffer = new WebRtc_UWord8[length]; encodedBuffer._buffer = new WebRtc_UWord8[length];
encodedBuffer._size = length; encodedBuffer._size = length;
encodedBuffer._length = length; encodedBuffer._length = length;
fread(encodedBuffer._buffer, 1, length, openFile); if (fread(encodedBuffer._buffer, 1, length, openFile) != length)
{
printf("Error reading file %s\n", fileName.c_str());
exit(1);
}
fclose(openFile); fclose(openFile);
// ------------------ // ------------------

View File

@ -71,7 +71,12 @@ int convert_test(CmdArgs& args)
// reading first frame of Foreman sequence // reading first frame of Foreman sequence
WebRtc_UWord8* origBuffer = new WebRtc_UWord8[width * height*3/2]; WebRtc_UWord8* origBuffer = new WebRtc_UWord8[width * height*3/2];
fread(origBuffer, 1, lengthSourceFrame, sourceFile); if (fread(origBuffer, 1, lengthSourceFrame, sourceFile) !=
lengthSourceFrame)
{
printf("Error reading file %s\n", inname.c_str());
exit(1);
}
// START TEST // START TEST
printf("\nTEST #%d I420 <-> RGB24\n", j); printf("\nTEST #%d I420 <-> RGB24\n", j);

View File

@ -65,7 +65,6 @@ void CreateImage(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFr
void ValidateImage2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor) void ValidateImage2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor)
{ {
WebRtc_Word32 k = 0;
WebRtc_Word32 res = offset*factor; WebRtc_Word32 res = offset*factor;
for (WebRtc_Word32 i = 0; i < height; i++) for (WebRtc_Word32 i = 0; i < height; i++)
{ {
@ -82,7 +81,6 @@ void ValidateImage2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* pt
void ValidateImage3_2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor) void ValidateImage3_2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor)
{ {
WebRtc_Word32 k = 0;
WebRtc_Word32 res = offset*factor; WebRtc_Word32 res = offset*factor;
for (WebRtc_Word32 i = 1; i <= height; i++) for (WebRtc_Word32 i = 1; i <= height; i++)
{ {
@ -100,7 +98,6 @@ void ValidateImage3_2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8*
void ValidateImage1_3(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor) void ValidateImage1_3(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor)
{ {
WebRtc_Word32 k = 0;
WebRtc_Word32 res = offset*factor; WebRtc_Word32 res = offset*factor;
res += factor/2; res += factor/2;
for (WebRtc_Word32 i = 0; i < height; i++) for (WebRtc_Word32 i = 0; i < height; i++)