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
316 316
317void GetValidEncParamBase (SEncParamBase* pEncParamBase) {317void GetValidEncParamBase (SEncParamBase* pEncParamBase) {
318 pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME;318 pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME;
319 pEncParamBase->iPicWidth = ((rand() * 2) % (MAX_WIDTH));319 pEncParamBase->iPicWidth = 2 + ((rand() * 2) % (MAX_WIDTH - 2));
320 pEncParamBase->iPicHeight = ((rand() * 2) % (MAX_HEIGHT));320 pEncParamBase->iPicHeight = 2 + ((rand() * 2) % (MAX_HEIGHT - 2));
321 pEncParamBase->iPicWidth = VALID_SIZE(pEncParamBase->iPicWidth);321 pEncParamBase->iPicWidth = VALID_SIZE(pEncParamBase->iPicWidth);
322 pEncParamBase->iPicHeight = VALID_SIZE(pEncParamBase->iPicHeight);322 pEncParamBase->iPicHeight = VALID_SIZE(pEncParamBase->iPicHeight);
323 pEncParamBase->iTargetBitrate = rand() + 1; //!=0323 pEncParamBase->iTargetBitrate = rand() + 1; //!=0
@@ -470,8 +470,8 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 146 unmodified lines
470 SEncParamExt sEncParamExt;470 SEncParamExt sEncParamExt;
471 pPtrEnc->GetDefaultParams (&sEncParamExt);471 pPtrEnc->GetDefaultParams (&sEncParamExt);
472 sEncParamExt.iUsageType = CAMERA_VIDEO_REAL_TIME;472 sEncParamExt.iUsageType = CAMERA_VIDEO_REAL_TIME;
473 sEncParamExt.iPicWidth = abs ((rand() * 2) + MB_SIZE) % (MAX_WIDTH + 1);473 sEncParamExt.iPicWidth = MB_SIZE + abs ((rand() * 2) % (MAX_WIDTH - MB_SIZE));
474 sEncParamExt.iPicHeight = abs ((rand() * 2) + MB_SIZE) % (MAX_HEIGHT + 1);474 sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE));
475 sEncParamExt.iTargetBitrate = rand() + 1; //!=0475 sEncParamExt.iTargetBitrate = rand() + 1; //!=0
476 sEncParamExt.iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2476 sEncParamExt.iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2
477 sEncParamExt.fMaxFrameRate = rand() + 0.5f; //!=0477 sEncParamExt.fMaxFrameRate = rand() + 0.5f; //!=0
@@ -550,4 +550,4 @@ TEST_F (EncoderInterfaceTest, EncodeParameterSets) { · 72 unmodified lines
550 550
551TEST_F (EncoderInterfaceTest, BasicReturnTypeTest) {551TEST_F (EncoderInterfaceTest, BasicReturnTypeTest) {
552 //TODO552 //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