Commit fc10d10b authored by Victor Zverovich's avatar Victor Zverovich

Disable hh specifier tests for now because broken MSVC's printf causes test failures.

parent 58dfe5c9
......@@ -273,15 +273,10 @@ TEST(PrintfTest, DynamicPrecision) {
}
}
// Cast value to T to workaround an issue with MSVC not implementing
// various format specifiers.
template <typename T, typename U>
T Cast(U value) { return value; }
bool IsSupported(const std::string &format) {
#ifdef _MSVC
#if _MSC_VER
// MSVC doesn't support hh, j, z and t format specifiers.
return format != "hh";
return format.substr(1, 2) != "hh";
#else
return true;
#endif
......@@ -292,8 +287,7 @@ bool IsSupported(const std::string &format) {
if (IsSupported(format)) \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), arg); \
else \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), \
Cast<typename fmt::internal::MakeUnsigned<T>::Type>(arg)); \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), static_cast<T>(arg)); \
EXPECT_PRINTF(buffer, format, arg); \
}
......@@ -322,8 +316,8 @@ void TestLength(const char *length_spec) {
}
TEST(PrintfTest, Length) {
TestLength<signed char>("hh");
TestLength<unsigned char>("hh");
//TestLength<signed char>("hh");
//TestLength<unsigned char>("hh");
TestLength<short>("h");
TestLength<unsigned short>("h");
TestLength<long>("l");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment