Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
fc10d10b
Commit
fc10d10b
authored
Aug 01, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable hh specifier tests for now because broken MSVC's printf causes test failures.
parent
58dfe5c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
test/printf-test.cc
test/printf-test.cc
+5
-11
No files found.
test/printf-test.cc
View file @
fc10d10b
...
@@ -273,15 +273,10 @@ TEST(PrintfTest, DynamicPrecision) {
...
@@ -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
)
{
bool
IsSupported
(
const
std
::
string
&
format
)
{
#if
def _MSVC
#if
_MSC_VER
// MSVC doesn't support hh, j, z and t format specifiers.
// MSVC doesn't support hh, j, z and t format specifiers.
return
format
!=
"hh"
;
return
format
.
substr
(
1
,
2
)
!=
"hh"
;
#else
#else
return
true
;
return
true
;
#endif
#endif
...
@@ -292,8 +287,7 @@ bool IsSupported(const std::string &format) {
...
@@ -292,8 +287,7 @@ bool IsSupported(const std::string &format) {
if (IsSupported(format)) \
if (IsSupported(format)) \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), arg); \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), arg); \
else \
else \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), \
safe_sprintf(buffer, fmt::StringRef(format).c_str(), static_cast<T>(arg)); \
Cast<typename fmt::internal::MakeUnsigned<T>::Type>(arg)); \
EXPECT_PRINTF(buffer, format, arg); \
EXPECT_PRINTF(buffer, format, arg); \
}
}
...
@@ -322,8 +316,8 @@ void TestLength(const char *length_spec) {
...
@@ -322,8 +316,8 @@ void TestLength(const char *length_spec) {
}
}
TEST
(
PrintfTest
,
Length
)
{
TEST
(
PrintfTest
,
Length
)
{
TestLength
<
signed
char
>
(
"hh"
);
//
TestLength<signed char>("hh");
TestLength
<
unsigned
char
>
(
"hh"
);
//
TestLength<unsigned char>("hh");
TestLength
<
short
>
(
"h"
);
TestLength
<
short
>
(
"h"
);
TestLength
<
unsigned
short
>
(
"h"
);
TestLength
<
unsigned
short
>
(
"h"
);
TestLength
<
long
>
(
"l"
);
TestLength
<
long
>
(
"l"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment