History

Don't set iPicWidth or iPicHeight to 0 in random tests

This should fix occasional failures in the EncoderInterfaceTests, such as in https://travis-ci.org/cisco/openh264/jobs/30815104.

Martin Storsjö committed 12 years ago

Commit 65439001 parent e2861441 file · +5 −5Browse files

Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all

Unified · Split

test/encoder/EncUT_EncoderExt.cpp+5−5
@@ -316,8 +316,8 @@ TEST_F (EncoderInterfaceTest, MemoryCheckTest) { · 315 unmodified lines
316316
317317 void GetValidEncParamBase (SEncParamBase* pEncParamBase) {
318318 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));
321321 pEncParamBase->iPicWidth = VALID_SIZE(pEncParamBase->iPicWidth);
322322 pEncParamBase->iPicHeight = VALID_SIZE(pEncParamBase->iPicHeight);
323323 pEncParamBase->iTargetBitrate = rand() + 1; //!=0
@@ -470,8 +470,8 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 146 unmodified lines
470470 SEncParamExt sEncParamExt;
471471 pPtrEnc->GetDefaultParams (&sEncParamExt);
472472 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));
475475 sEncParamExt.iTargetBitrate = rand() + 1; //!=0
476476 sEncParamExt.iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2
477477 sEncParamExt.fMaxFrameRate = rand() + 0.5f; //!=0
@@ -550,4 +550,4 @@ TEST_F (EncoderInterfaceTest, EncodeParameterSets) { · 72 unmodified lines
550550
551551 TEST_F (EncoderInterfaceTest, BasicReturnTypeTest) {
552552 //TODO
553−}
553+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t