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
128128 }
129129 }
130130 //Init members
131− void Init();
131+ int32_t Init();
132132 //Uninit members
133133 void Uninit();
134134 //Decoder real bitstream
@@ -155,7 +155,7 @@ class DecoderParseSyntaxTest : public ::testing::Test { · 20 unmodified lines
155155 };
156156
157157 //Init members
158−void DecoderParseSyntaxTest::Init() {
158+int32_t DecoderParseSyntaxTest::Init() {
159159 memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));
160160 memset (&m_sDecParam, 0, sizeof (SDecodingParam));
161161 memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo));
@@ -180,7 +180,7 @@ void DecoderParseSyntaxTest::Init() { · 18 unmodified lines
180180 m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
181181 }
182182 CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx);
183− (void) eRet;
183+ return (int32_t)eRet;
184184 }
185185
186186 void DecoderParseSyntaxTest::Uninit() {
@@ -262,7 +262,9 @@ void DecoderParseSyntaxTest::TestScalingList() { · 75 unmodified lines
262262 uint8_t iScalingListPPS[6][16];
263263 memset (iScalingListPPS, 0, 6 * 16 * sizeof (uint8_t));
264264 //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);
266268 DecodeBs ("res/BA_MW_D.264");
267269 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag == false);
268270 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
270272 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
271273 Uninit();
272274 //Scalinglist value just written into sps and pps
273− Init();
275+ iRet = Init();
276+ ASSERT_EQ (iRet, ERR_NONE);
274277 DecodeBs ("res/test_scalinglist_jm.264");
275278 ASSERT_TRUE (m_pCtx->sSpsBuffer[0].bSeqScalingMatrixPresentFlag);
276279 for (int i = 0; i < 6; i++) {
@@ -280,8 +283,6 @@ void DecoderParseSyntaxTest::TestScalingList() { · 3 unmodified lines
280283 ASSERT_TRUE (m_pCtx->sPpsBuffer[0].bPicScalingMatrixPresentFlag == false);
281284 EXPECT_EQ (0, memcmp (iScalingListPPS, m_pCtx->sPpsBuffer[0].iScalingList4x4, 6 * 16 * sizeof (uint8_t)));
282285 Uninit();
283−
284−
285286 }
286287
287288 //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