encoder log level adjustment in UT to avoid too many output and some formatting

This commit is contained in:
Sijia Chen 2014-12-11 14:31:32 +08:00
parent 44e4531897
commit f1a7a1a966
3 changed files with 14 additions and 4 deletions

View File

@ -63,6 +63,9 @@ void BaseEncoderTest::SetUp() {
int rv = WelsCreateSVCEncoder (&encoder_); int rv = WelsCreateSVCEncoder (&encoder_);
ASSERT_EQ (0, rv); ASSERT_EQ (0, rv);
ASSERT_TRUE (encoder_ != NULL); ASSERT_TRUE (encoder_ != NULL);
unsigned int uiTraceLevel = WELS_LOG_ERROR;
encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);
} }
void BaseEncoderTest::TearDown() { void BaseEncoderTest::TearDown() {

View File

@ -1071,7 +1071,7 @@ TEST_P (EncodeDecodeTestAPI, InOutTimeStamp) {
memset (&dstBufInfo_, 0, sizeof (SBufferInfo)); memset (&dstBufInfo_, 0, sizeof (SBufferInfo));
dstBufInfo_.uiInBsTimeStamp = uiEncTimeStamp; dstBufInfo_.uiInBsTimeStamp = uiEncTimeStamp;
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
if(dstBufInfo_.iBufferStatus == 1) { if (dstBufInfo_.iBufferStatus == 1) {
EXPECT_EQ (uiEncTimeStamp, dstBufInfo_.uiOutYuvTimeStamp); EXPECT_EQ (uiEncTimeStamp, dstBufInfo_.uiOutYuvTimeStamp);
} }
iIdx++; iIdx++;
@ -2064,11 +2064,14 @@ TEST_F (EncodeDecodeTestAPI, SetOptionEncParamExt) {
int iSliceNum = 1; int iSliceNum = 1;
encoder_->GetDefaultParams (&param_); encoder_->GetDefaultParams (&param_);
prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate); prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate);
int rv = encoder_->InitializeExt (&param_); int rv = encoder_->InitializeExt (&param_);
ASSERT_TRUE (rv == cmResultSuccess); ASSERT_TRUE (rv == cmResultSuccess);
int32_t iTraceLevel = WELS_LOG_QUIET; int iTraceLevel = WELS_LOG_QUIET;
encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel); rv = encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
ASSERT_TRUE (rv == cmResultSuccess);
for (int i = 0; i < iEncFrameNum; i++) { for (int i = 0; i < iEncFrameNum; i++) {
int iResult; int iResult;
int len = 0; int len = 0;
@ -2304,7 +2307,8 @@ TEST_F (DecodeCrashTestAPI, DecoderCrashTest) {
} while (1); //while (iLoopRound<100); } while (1); //while (iLoopRound<100);
fclose (f); fclose (f);
#else #else
} while (uiLoopRound < 10); }
while (uiLoopRound < 10);
#endif #endif
} }

View File

@ -29,6 +29,9 @@ class EncoderInterfaceTest : public ::testing::Test {
ASSERT_EQ (0, rv); ASSERT_EQ (0, rv);
ASSERT_TRUE (pPtrEnc != NULL); ASSERT_TRUE (pPtrEnc != NULL);
unsigned int uiTraceLevel = WELS_LOG_ERROR;
pPtrEnc->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);
pParamExt = new SEncParamExt(); pParamExt = new SEncParamExt();
ASSERT_TRUE (pParamExt != NULL); ASSERT_TRUE (pParamExt != NULL);