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
271 EXPECT_EQ (eRet, cmResultSuccess);271 EXPECT_EQ (eRet, cmResultSuccess);
272 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);272 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
273 EXPECT_EQ (eRet, cmResultSuccess);273 EXPECT_EQ (eRet, cmResultSuccess);
274 EXPECT_EQ (iOut, iTmp != 0);274 EXPECT_EQ (iOut, iTmp != 0 ? 1 : 0);
275 }275 }
276 276
277 //set false as input277 //set false as input
@@ -281,7 +281,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 3 unmodified lines
281 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);281 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
282 EXPECT_EQ (eRet, cmResultSuccess);282 EXPECT_EQ (eRet, cmResultSuccess);
283 283
284 EXPECT_EQ (iOut, false);284 EXPECT_EQ (iOut, 0);
285 285
286 //set true as input286 //set true as input
287 iTmp = true;287 iTmp = true;
@@ -290,24 +290,24 @@ void DecoderInterfaceTest::TestEndOfStream() { · 2 unmodified lines
290 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);290 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
291 EXPECT_EQ (eRet, cmResultSuccess);291 EXPECT_EQ (eRet, cmResultSuccess);
292 292
293 EXPECT_EQ (iOut, true);293 EXPECT_EQ (iOut, 1);
294 294
295 //Mock data packet in295 //Mock data packet in
296 //Test NULL data input for decoder, should be true for EOS296 //Test NULL data input for decoder, should be true for EOS
297 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);297 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);
298 EXPECT_EQ (eRet, 0); //decode should return OK298 EXPECT_EQ (eRet, 0); //decode should return OK
299 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);299 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
300 EXPECT_EQ (iOut, true); //decoder should have EOS == true300 EXPECT_EQ (iOut, 1); //decoder should have EOS == true
301 301
302 //Test valid data input for decoder, should be false for EOS302 //Test valid data input for decoder, should be false for EOS
303 MockPacketType (NAL_UNIT_UNSPEC_0, 50);303 MockPacketType (NAL_UNIT_UNSPEC_0, 50);
304 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (m_szBuffer, m_iBufLength, m_pData, &m_sBufferInfo);304 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (m_szBuffer, m_iBufLength, m_pData, &m_sBufferInfo);
305 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);305 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
306 EXPECT_EQ (iOut, false); //decoder should have EOS == false306 EXPECT_EQ (iOut, 0); //decoder should have EOS == false
307 //Test NULL data input for decoder, should be true for EOS307 //Test NULL data input for decoder, should be true for EOS
308 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);308 eRet = (CM_RETURN) m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);
309 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);309 eRet = (CM_RETURN) m_pDec->GetOption (DECODER_OPTION_END_OF_STREAM, &iOut);
310 EXPECT_EQ (iOut, true); //decoder should have EOS == true310 EXPECT_EQ (iOut, 1); //decoder should have EOS == true
311 311
312 Uninit();312 Uninit();
313}313}

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