This should fix occasional failures in the EncoderInterfaceTests, such as in https://travis-ci.org/cisco/openh264/jobs/30815104.
Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -316,8 +316,8 @@ TEST_F (EncoderInterfaceTest, MemoryCheckTest) { · 315 unmodified lines | ||
| 316 | 316 | |
| 317 | 317 | void GetValidEncParamBase (SEncParamBase* pEncParamBase) { |
| 318 | 318 | pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME; |
| 319 | − pEncParamBase->iPicWidth = ((rand() * 2) % (MAX_WIDTH)); | |
| 320 | − pEncParamBase->iPicHeight = ((rand() * 2) % (MAX_HEIGHT)); | |
| 319 | + pEncParamBase->iPicWidth = 2 + ((rand() * 2) % (MAX_WIDTH - 2)); | |
| 320 | + pEncParamBase->iPicHeight = 2 + ((rand() * 2) % (MAX_HEIGHT - 2)); | |
| 321 | 321 | pEncParamBase->iPicWidth = VALID_SIZE(pEncParamBase->iPicWidth); |
| 322 | 322 | pEncParamBase->iPicHeight = VALID_SIZE(pEncParamBase->iPicHeight); |
| 323 | 323 | pEncParamBase->iTargetBitrate = rand() + 1; //!=0 |
| @@ -470,8 +470,8 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 146 unmodified lines | ||
| 470 | 470 | SEncParamExt sEncParamExt; |
| 471 | 471 | pPtrEnc->GetDefaultParams (&sEncParamExt); |
| 472 | 472 | sEncParamExt.iUsageType = CAMERA_VIDEO_REAL_TIME; |
| 473 | − sEncParamExt.iPicWidth = abs ((rand() * 2) + MB_SIZE) % (MAX_WIDTH + 1); | |
| 474 | − sEncParamExt.iPicHeight = abs ((rand() * 2) + MB_SIZE) % (MAX_HEIGHT + 1); | |
| 473 | + sEncParamExt.iPicWidth = MB_SIZE + abs ((rand() * 2) % (MAX_WIDTH - MB_SIZE)); | |
| 474 | + sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE)); | |
| 475 | 475 | sEncParamExt.iTargetBitrate = rand() + 1; //!=0 |
| 476 | 476 | sEncParamExt.iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2 |
| 477 | 477 | sEncParamExt.fMaxFrameRate = rand() + 0.5f; //!=0 |
| @@ -550,4 +550,4 @@ TEST_F (EncoderInterfaceTest, EncodeParameterSets) { · 72 unmodified lines | ||
| 550 | 550 | |
| 551 | 551 | TEST_F (EncoderInterfaceTest, BasicReturnTypeTest) { |
| 552 | 552 | //TODO |
| 553 | −} | |
| 553 | +} | |