mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 06:21:00 +00:00
Fix a warning.
This commit is contained in:
parent
4d049cf598
commit
7e40ca6a9c
@ -126,22 +126,23 @@ TEST(ArgTest, ArgInfo) {
|
|||||||
EXPECT_EQ(&p, ArgInfo<Arg::CUSTOM>::get(arg).value);
|
EXPECT_EQ(&p, ArgInfo<Arg::CUSTOM>::get(arg).value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EXPECT_ARG_(Char, type_code, Type, value) { \
|
#define EXPECT_ARG_(Char, type_code, MakeArgType, ExpectedType, value) { \
|
||||||
Type expected_value = static_cast<Type>(value); \
|
Arg arg = MakeArg<Char>(static_cast<MakeArgType>(value)); \
|
||||||
Arg arg = MakeArg<Char>(expected_value); \
|
|
||||||
EXPECT_EQ(Arg::type_code, arg.type); \
|
EXPECT_EQ(Arg::type_code, arg.type); \
|
||||||
|
ExpectedType expected_value = static_cast<ExpectedType>(value); \
|
||||||
EXPECT_EQ(expected_value, ArgInfo<Arg::type_code>::get(arg)); \
|
EXPECT_EQ(expected_value, ArgInfo<Arg::type_code>::get(arg)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EXPECT_ARG(type_code, Type, value) \
|
#define EXPECT_ARG(type_code, Type, value) \
|
||||||
EXPECT_ARG_(char, type_code, Type, value)
|
EXPECT_ARG_(char, type_code, Type, Type, value)
|
||||||
|
|
||||||
#define EXPECT_ARGW(type_code, Type, value) \
|
#define EXPECT_ARGW(type_code, Type, value) \
|
||||||
EXPECT_ARG_(wchar_t, type_code, Type, value)
|
EXPECT_ARG_(wchar_t, type_code, Type, Type, value)
|
||||||
|
|
||||||
TEST(ArgTest, MakeArg) {
|
TEST(ArgTest, MakeArg) {
|
||||||
// Test bool.
|
// Test bool.
|
||||||
EXPECT_ARG(INT, bool, true);
|
EXPECT_ARG_(char, INT, bool, int, true);
|
||||||
|
EXPECT_ARG_(wchar_t, INT, bool, int, true);
|
||||||
|
|
||||||
// Test char.
|
// Test char.
|
||||||
EXPECT_ARG(CHAR, signed char, 'a');
|
EXPECT_ARG(CHAR, signed char, 'a');
|
||||||
|
Loading…
Reference in New Issue
Block a user