ref: 19db13a5c5db7ebe98ddf63e00b13341757f59aa
parent: 69db7f675cf3623ef0002ef78e221ed2202bf2d0
parent: e5b72f320832c060433adc97b44b02ca77083b14
author: huili2 <[email protected]>
date: Mon Jul 6 13:21:07 EDT 2020
Merge pull request #3304 from alatiera/alatiera/dangling-else DecUT_ParseSyntax.cpp: avoid dangling-else warning in if statements
--- a/test/decoder/DecUT_ParseSyntax.cpp
+++ b/test/decoder/DecUT_ParseSyntax.cpp
@@ -279,10 +279,11 @@
iRet |= DecodeFrame (pBuf + iBufPos, iSliceSize, m_pData, &m_sBufferInfo, m_pCtx);
iBufPos += iSliceSize;
}
- if (eDecCase == CorrectDec)
+ if (eDecCase == CorrectDec) {
EXPECT_TRUE (iRet == dsErrorFree);
- else if (eDecCase == ErrorDec)
+ } else if (eDecCase == ErrorDec) {
EXPECT_TRUE ((iRet & (dsBitstreamError | dsRefLost | dsDataErrorConcealed)) != 0) << "iRet = " << iRet;
+ }
fclose (pH264File);
if (pBuf) {
@@ -347,15 +348,18 @@
memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo));
iRet |= m_pDec->DecodeParser (pBuf + iBufPos, iSliceSize, &m_sParserBsInfo);
iRet |= m_pDec->DecodeParser (NULL, 0, &m_sParserBsInfo);
- if (eDecCase == CorrectParseOnly)
+ if (eDecCase == CorrectParseOnly) {
EXPECT_TRUE (iRet == dsErrorFree || iRet == dsFramePending);
+ }
+
iBufPos += iSliceSize;
++iSliceIndex;
if (iSliceIndex == 4)
break;
}
- if (eDecCase == ErrorDec)
+ if (eDecCase == ErrorDec) {
EXPECT_TRUE ((iRet & (dsBitstreamError | dsRefLost | dsDataErrorConcealed)) != 0) << iRet;
+ }
fclose (pH264File);
if (pBuf) {