History

Fix the decoder init failed case in UT

Haibo Zhu committed 10 years ago

Commit 46f42ec1 parent 25f53a25 files · +63 −28Browse files

Showing the changes to test/decoder/DecUT_ParseSyntax.cpp (1 of 5 files). Show all

Unified · Split

test/decoder/DecUT_ParseSyntax.cpp+8−7
@@ -128,7 +128,7 @@ class DecoderParseSyntaxTest : public ::testing::Test { · 127 unmodified lines
128 }128 }
129 }129 }
130 //Init members130 //Init members
131 void Init();131 int32_t Init();
132 //Uninit members132 //Uninit members
133 void Uninit();133 void Uninit();
134 //Decoder real bitstream134 //Decoder real bitstream
@@ -155,7 +155,7 @@ class DecoderParseSyntaxTest : public ::testing::Test { · 20 unmodified lines
155};155};
156 156
157//Init members157//Init members
158void DecoderParseSyntaxTest::Init() {158int32_t DecoderParseSyntaxTest::Init() {
159 memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));159 memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));
160 memset (&m_sDecParam, 0, sizeof (SDecodingParam));160 memset (&m_sDecParam, 0, sizeof (SDecodingParam));
161 memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo));161 memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo));
@@ -180,7 +180,7 @@ void DecoderParseSyntaxTest::Init() { · 18 unmodified lines
180 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);180 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
181 }181 }
182 CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx);182 CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx);
183 (void) eRet;183 return (int32_t)eRet;
184}184}
185 185
186void DecoderParseSyntaxTest::Uninit() {186void DecoderParseSyntaxTest::Uninit() {
@@ -262,7 +262,9 @@ void DecoderParseSyntaxTest::TestScalingList() { · 75 unmodified lines
262 uint8_t iScalingListPPS[6][16];262 uint8_t iScalingListPPS[6][16];
263 memset (iScalingListPPS, 0, 6 * 16 * sizeof (uint8_t));263 memset (iScalingListPPS, 0, 6 * 16 * sizeof (uint8_t));
264 //Scalinglist matrix not written into sps or pps264 //Scalinglist matrix not written into sps or pps
265 Init();265 int32_t iRet = ERR_NONE;
266 iRet = Init();
267 ASSERT_EQ (iRet, ERR_NONE);
266 DecodeBs ("res/BA_MW_D.264");268 DecodeBs ("res/BA_MW_D.264");
267 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false);269 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false);
268 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));270 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sSpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
@@ -270,7 +272,8 @@ void DecoderParseSyntaxTest::TestScalingList() { · 1 unmodified line
270 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));272 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
271 Uninit();273 Uninit();
272 //Scalinglist value just written into sps and pps274 //Scalinglist value just written into sps and pps
273 Init();275 iRet = Init();
276 ASSERT_EQ (iRet, ERR_NONE);
274 DecodeBs ("res/test_scalinglist_jm.264");277 DecodeBs ("res/test_scalinglist_jm.264");
275 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag);278 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag);
276 for (int i = 0; i < 6; i++) {279 for (int i = 0; i < 6; i++) {
@@ -280,8 +283,6 @@ void DecoderParseSyntaxTest::TestScalingList() { · 3 unmodified lines
280 ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);283 ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);
281 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));284 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
282 Uninit();285 Uninit();
283
284
285}286}
286 287
287//TEST here for whole tests288//TEST here for whole tests

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