diff --git a/src/common_video/jpeg/main/test/test_jpeg.cc b/src/common_video/jpeg/main/test/test_jpeg.cc index f9bb4b3e99..def5c002c0 100644 --- a/src/common_video/jpeg/main/test/test_jpeg.cc +++ b/src/common_video/jpeg/main/test/test_jpeg.cc @@ -61,7 +61,7 @@ main(int argc, char **argv) if (fread(encodedBuffer._buffer, 1, length, openFile) != length) { printf("Error reading file %s\n", fileName.c_str()); - exit(1); + return 1; } fclose(openFile); diff --git a/src/common_video/vplib/main/test/convert_test.cc b/src/common_video/vplib/main/test/convert_test.cc index dad947109a..5dd759b8a6 100644 --- a/src/common_video/vplib/main/test/convert_test.cc +++ b/src/common_video/vplib/main/test/convert_test.cc @@ -56,17 +56,17 @@ int convert_test(CmdArgs& args) if ((sourceFile = fopen(inname.c_str(), "rb")) == NULL) { printf("Cannot read file %s.\n", inname.c_str()); - exit(1); + return 1; } if ((outputFile = fopen(outname.c_str(), "wb")) == NULL) { printf("Cannot write file %s.\n", outname.c_str()); - exit(1); + return 1; } if ((logFile = fopen("../log.txt", "a")) == NULL) { printf("Cannot write file ../log.txt.\n"); - exit(1); + return 1; } // reading first frame of Foreman sequence @@ -75,7 +75,7 @@ int convert_test(CmdArgs& args) lengthSourceFrame) { printf("Error reading file %s\n", inname.c_str()); - exit(1); + return 1; } // START TEST diff --git a/src/common_video/vplib/main/test/scale_test.cc b/src/common_video/vplib/main/test/scale_test.cc index eade7b109c..e7ac5a0347 100644 --- a/src/common_video/vplib/main/test/scale_test.cc +++ b/src/common_video/vplib/main/test/scale_test.cc @@ -65,12 +65,14 @@ 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) { + int k = 0; WebRtc_Word32 res = offset*factor; for (WebRtc_Word32 i = 0; i < height; i++) { for (WebRtc_Word32 j = 0; j < width; j++) { - assert(ptrFrame[k++] == res); + assert(ptrFrame[k] == res); + k++; } if (i > 0) { @@ -81,12 +83,14 @@ 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) { + int k = 0; WebRtc_Word32 res = offset*factor; for (WebRtc_Word32 i = 1; i <= height; i++) { for (WebRtc_Word32 j = 0; j < width; j++) { - assert(ptrFrame[k++] == res); + assert(ptrFrame[k] == res); + k++; } res += factor/2; if ((i % 3) == 0) @@ -98,13 +102,15 @@ 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) { + int k = 0; WebRtc_Word32 res = offset*factor; res += factor/2; for (WebRtc_Word32 i = 0; i < height; i++) { for (WebRtc_Word32 j = 0; j < width; j++) { - assert(ptrFrame[k++] == res); + assert(ptrFrame[k] == res); + k++; } res += factor*3; }