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.
Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -205,9 +205,10 @@ TEST_F (EncoderInterfaceTest, EncoderOptionSetTest) { · 204 unmodified lines | ||
| 205 | 205 | else { |
| 206 | 206 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 207 | 207 | |
| 208 | + fFrameRate = WELS_CLIP3 (fFrameRate, 1, 60); | |
| 208 | 209 | iResult = pPtrEnc->GetOption (eOptionId, &fReturn); |
| 209 | 210 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 210 | − EXPECT_EQ (WELS_CLIP3 (fFrameRate, 1, 60), fReturn); | |
| 211 | + EXPECT_EQ (fFrameRate, fReturn); | |
| 211 | 212 | } |
| 212 | 213 | PrepareOneSrcFrame(); |
| 213 | 214 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |