X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2Ftest%2FConvTest.cpp;h=8967a7d0f0a454a66739a1de33b2467a4d4a5fd9;hp=625a651dee17b15e4466ebfb8b5a0f9ad2a087f8;hb=b05969e4b4474cadf1cb1f8ebc37567cc63c9b88;hpb=17b973baa8c4a5fc9f80807b2ddfe874c7cc4bb0 diff --git a/folly/test/ConvTest.cpp b/folly/test/ConvTest.cpp index 625a651d..8967a7d0 100644 --- a/folly/test/ConvTest.cpp +++ b/folly/test/ConvTest.cpp @@ -25,14 +25,7 @@ using namespace std; using namespace folly; -static int8_t s8; -static uint8_t u8; -static int16_t s16; -static uint16_t u16; -static int32_t s32; -static uint32_t u32; -static int64_t s64; -static uint64_t u64; + TEST(Conv, digits10Minimal) { // Not much of a test (and it's included in the test below anyway). @@ -124,7 +117,7 @@ TEST(Conv, Type2Type) { TEST(Conv, Integral2Integral) { // Same size, different signs - s64 = numeric_limits::max(); + int64_t s64 = numeric_limits::max(); EXPECT_EQ(to(s64), s64); s64 = numeric_limits::max(); @@ -644,6 +637,7 @@ TEST(Conv, DoubleToInt) { EXPECT_EQ(i, 42); try { auto i = to(42.1); + LOG(ERROR) << "to returned " << i << " instead of throwing"; EXPECT_TRUE(false); } catch (std::range_error& e) { //LOG(INFO) << e.what(); @@ -658,7 +652,9 @@ TEST(Conv, EnumToInt) { EXPECT_EQ(j, 42); try { auto i = to(y); - LOG(ERROR) << static_cast(i); + LOG(ERROR) << "to returned " + << static_cast(i) + << " instead of throwing"; EXPECT_TRUE(false); } catch (std::range_error& e) { //LOG(INFO) << e.what(); @@ -681,6 +677,9 @@ TEST(Conv, IntToEnum) { EXPECT_EQ(j, 100); try { auto i = to(5000000000L); + LOG(ERROR) << "to returned " + << static_cast(i) + << " instead of throwing"; EXPECT_TRUE(false); } catch (std::range_error& e) { //LOG(INFO) << e.what(); @@ -697,7 +696,7 @@ TEST(Conv, UnsignedEnum) { EXPECT_EQ(e, x); try { auto i = to(x); - LOG(ERROR) << to(x); + LOG(ERROR) << "to returned " << i << " instead of throwing"; EXPECT_TRUE(false); } catch (std::range_error& e) { } @@ -714,7 +713,7 @@ TEST(Conv, UnsignedEnumClass) { EXPECT_EQ(e, E::x); try { auto i = to(E::x); - LOG(ERROR) << to(E::x); + LOG(ERROR) << "to returned " << i << " instead of throwing"; EXPECT_TRUE(false); } catch (std::range_error& e) { }