mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 12:43:52 +00:00
parent
76d2cde656
commit
734af661c6
@ -1,5 +1,6 @@
|
|||||||
#include "app_helper.hpp"
|
#include "app_helper.hpp"
|
||||||
|
|
||||||
|
#include <climits>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@ -553,8 +554,8 @@ TEST(Types, TypeName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(Types, OverflowSmall) {
|
TEST(Types, OverflowSmall) {
|
||||||
char x;
|
signed char x;
|
||||||
auto strmax = std::to_string(INT8_MAX + 1);
|
auto strmax = std::to_string(SCHAR_MAX + 1);
|
||||||
EXPECT_FALSE(CLI::detail::lexical_cast(strmax, x));
|
EXPECT_FALSE(CLI::detail::lexical_cast(strmax, x));
|
||||||
|
|
||||||
unsigned char y;
|
unsigned char y;
|
||||||
@ -641,7 +642,7 @@ TEST(Types, LexicalCastParsable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(Types, LexicalCastEnum) {
|
TEST(Types, LexicalCastEnum) {
|
||||||
enum t1 : char { v1 = 5, v3 = 7, v5 = -9 };
|
enum t1 : signed char { v1 = 5, v3 = 7, v5 = -9 };
|
||||||
|
|
||||||
t1 output;
|
t1 output;
|
||||||
EXPECT_TRUE(CLI::detail::lexical_cast("-9", output));
|
EXPECT_TRUE(CLI::detail::lexical_cast("-9", output));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user