Mike
unread,Oct 14, 2008, 10:12:43 PM10/14/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google C++ Testing Framework
When compiling a file using google-test with gcc/g++ 4.2.3 on Ubuntu,
the following code:
std::vector a;
EXPECT_EQ(0, a.size();
results in this warning (with -Wall gcc flag set):
gtest/gtest.h:651: instantiated from ‘static
testing::AssertionResult
testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*,
const char*, const T1&, const T2&) [with T1 = int, T2 = size_t, bool
lhs_is_null_literal = false]’
gtest/gtest.h:618: warning: comparison between signed and unsigned
integer expressions
I can work around the warning by casting one of the values, such as
std::vector a;
EXPECT_EQ(size_t(0), a.size();
This is not ideal -- is there any cleaner way to get rid of the signed/
unsigned warning?