History

Consistently compare integers with integers and bools with bools

MSVC warns when comparing integers with booleans in with the gtest assertion macros.

Martin Storsjö committed 11 years ago

Commit 99925981 parent cd552013 files · +14 −14Browse files

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

Unified · Split

test/decoder/DecUT_DecExt.cpp+6−6
@@ -271,7 +271,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 270 unmodified lines
271271 EXPECT_EQ (eRet, cmResultSuccess);
272272 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
273273 EXPECT_EQ (eRet, cmResultSuccess);
274− EXPECT_EQ (iOut, iTmp != 0);
274+ EXPECT_EQ (iOut, iTmp != 0 ? 1 : 0);
275275 }
276276
277277 //set false as input
@@ -281,7 +281,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 3 unmodified lines
281281 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
282282 EXPECT_EQ (eRet, cmResultSuccess);
283283
284− EXPECT_EQ (iOut, false);
284+ EXPECT_EQ (iOut, 0);
285285
286286 //set true as input
287287 iTmp = true;
@@ -290,24 +290,24 @@ void DecoderInterfaceTest::TestEndOfStream() { · 2 unmodified lines
290290 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
291291 EXPECT_EQ (eRet, cmResultSuccess);
292292
293− EXPECT_EQ (iOut, true);
293+ EXPECT_EQ (iOut, 1);
294294
295295 //Mock data packet in
296296 //Test NULL data input for decoder, should be true for EOS
297297 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);
298298 EXPECT_EQ (eRet, 0); //decode should return OK
299299 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
300− EXPECT_EQ (iOut, true); //decoder should have EOS == true
300+ EXPECT_EQ (iOut, 1); //decoder should have EOS == true
301301
302302 //Test valid data input for decoder, should be false for EOS
303303 MockPacketType (NAL_UNIT_UNSPEC_0, 50);
304304 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (m_szBuffer, m_iBufLength, m_pData, &m_sBufferInfo);
305305 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
306− EXPECT_EQ (iOut, false); //decoder should have EOS == false
306+ EXPECT_EQ (iOut, 0); //decoder should have EOS == false
307307 //Test NULL data input for decoder, should be true for EOS
308308 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);
309309 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
310− EXPECT_EQ (iOut, true); //decoder should have EOS == true
310+ EXPECT_EQ (iOut, 1); //decoder should have EOS == true
311311
312312 Uninit();
313313 }

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