mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-08-17 15:19:48 +00:00
Implement handling of signed types and fix some build errors.
This commit is contained in:
parent
2c5030f929
commit
f9387114bf
2 changed files with 102 additions and 27 deletions
|
@ -89,4 +89,18 @@ TEST(helpers, lexical_cast) {
|
|||
const auto dec_str = lexical_cast<std::string, dec>(value);
|
||||
EXPECT_EQ("313249076", dec_str);
|
||||
}
|
||||
{
|
||||
const int32_t value = 0x7800;
|
||||
const auto hex_str = lexical_cast<std::string, hex>(value);
|
||||
EXPECT_EQ("7800", hex_str);
|
||||
const auto dec_str = lexical_cast<std::string, dec>(value);
|
||||
EXPECT_EQ("30720", dec_str);
|
||||
}
|
||||
{
|
||||
const int32_t value = -1400;
|
||||
const auto hex_str = lexical_cast<std::string, hex>(value);
|
||||
EXPECT_EQ("FFFFFA88", hex_str);
|
||||
const auto dec_str = lexical_cast<std::string, dec>(value);
|
||||
EXPECT_EQ("-1400", dec_str);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue