History

Clip fFrameRate locally in EncoderInterfaceTest.EncoderOptionSetTest

For the cases where we pass an out of range framerate to the encoder in the test, we already did test that the encoder internally clipped the value to 60. Clip the local variable as well, to make sure that later code in the test does the right decisions based on fFrameRate. This fixes a case where the check static_cast<float> (pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate) <= fFrameRate would indicate a failure, when the surrounding test used a value of fFrameRate different than the encoder used internally.

Martin Storsjö committed 8 years ago

Commit af9bce51 parent 3c8773c1 file · +2 −1Browse files

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

Unified · Split

test/encoder/EncUT_EncoderExt.cpp+2−1
@@ -205,9 +205,10 @@ TEST_F (EncoderInterfaceTest, EncoderOptionSetTest) { · 204 unmodified lines
205205 else {
206206 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
207207
208+ fFrameRate = WELS_CLIP3 (fFrameRate, 1, 60);
208209 iResult = pPtrEnc->GetOption (eOptionId, &fReturn);
209210 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
210− EXPECT_EQ (WELS_CLIP3 (fFrameRate, 1, 60), fReturn);
211+ EXPECT_EQ (fFrameRate, fReturn);
211212 }
212213 PrepareOneSrcFrame();
213214 iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);

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