EXPECT_TRUE(shouldWork == std::numeric_limits<float>::min() ||
shouldWork == 0.f);
} catch (...) {
- EXPECT_TRUE(false);
+ ADD_FAILURE();
}
}
// Test NaN conversion
try {
to<double>("not a number");
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (const std::range_error &) {
}
try {
to<int>(pc);
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (const std::range_error &) {
}
}
try {
to<int64_t>(&pc);
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (const std::range_error &) {
}
}
try {
to<double>(pc);
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (const std::range_error &) {
}
}
/* This seems not work in ubuntu11.10, gcc 4.6.1
try {
auto f = to<float>(957837589847);
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (std::range_error& e) {
//LOG(INFO) << e.what();
}
try {
auto i2 = to<int>(42.1);
LOG(ERROR) << "to<int> returned " << i2 << " instead of throwing";
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (std::range_error&) {
//LOG(INFO) << e.what();
}
LOG(ERROR) << "to<char> returned "
<< static_cast<unsigned int>(i2)
<< " instead of throwing";
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (std::range_error&) {
//LOG(INFO) << e.what();
}
LOG(ERROR) << "to<A> returned "
<< static_cast<unsigned int>(i2)
<< " instead of throwing";
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (std::range_error&) {
//LOG(INFO) << e.what();
}
try {
auto i = to<int32_t>(x);
LOG(ERROR) << "to<int32_t> returned " << i << " instead of throwing";
- EXPECT_TRUE(false);
+ ADD_FAILURE();
} catch (std::range_error&) {
}
}
std::string where = to<std::string>(__FILE__, "(", line, "): ");
try {
auto res = expr();
- EXPECT_TRUE(false) << where << exprStr << " -> " << res;
+ ADD_FAILURE() << where << exprStr << " -> " << res;
} catch (const ConversionError& e) {
EXPECT_EQ(code, e.errorCode()) << where << exprStr;
std::string str(e.what());