shithub: openh264

Download patch

ref: f1a7a1a96607bf54e8dd328f3859b420e24cea83
parent: 44e4531897657f977acaf2e3dbbccf32cd542d97
author: Sijia Chen <sijchen@cisco.com>
date: Thu Dec 11 09:31:32 EST 2014

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

--- a/test/api/BaseEncoderTest.cpp
+++ b/test/api/BaseEncoderTest.cpp
@@ -63,6 +63,9 @@
   int rv = WelsCreateSVCEncoder (&encoder_);
   ASSERT_EQ (0, rv);
   ASSERT_TRUE (encoder_ != NULL);
+
+  unsigned int uiTraceLevel = WELS_LOG_ERROR;
+  encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);
 }
 
 void BaseEncoderTest::TearDown() {
--- a/test/api/encode_decode_api_test.cpp
+++ b/test/api/encode_decode_api_test.cpp
@@ -1071,7 +1071,7 @@
     memset (&dstBufInfo_, 0, sizeof (SBufferInfo));
     dstBufInfo_.uiInBsTimeStamp = uiEncTimeStamp;
     rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
-    if(dstBufInfo_.iBufferStatus == 1) {
+    if (dstBufInfo_.iBufferStatus == 1) {
       EXPECT_EQ (uiEncTimeStamp, dstBufInfo_.uiOutYuvTimeStamp);
     }
     iIdx++;
@@ -2064,11 +2064,14 @@
   int iSliceNum        = 1;
   encoder_->GetDefaultParams (&param_);
   prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate);
+
   int rv = encoder_->InitializeExt (&param_);
   ASSERT_TRUE (rv == cmResultSuccess);
 
-  int32_t iTraceLevel = WELS_LOG_QUIET;
-  encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
+  int iTraceLevel = WELS_LOG_QUIET;
+  rv = encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
+  ASSERT_TRUE (rv == cmResultSuccess);
+
   for (int i = 0; i < iEncFrameNum; i++) {
     int iResult;
     int len = 0;
@@ -2304,7 +2307,8 @@
   } while (1); //while (iLoopRound<100);
   fclose (f);
 #else
-  } while (uiLoopRound < 10);
+  }
+  while (uiLoopRound < 10);
 #endif
 
 }
--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -29,6 +29,9 @@
     ASSERT_EQ (0, rv);
     ASSERT_TRUE (pPtrEnc != NULL);
 
+    unsigned int uiTraceLevel = WELS_LOG_ERROR;
+    pPtrEnc->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);
+
     pParamExt = new SEncParamExt();
     ASSERT_TRUE (pParamExt != NULL);