mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Don't store -1 into unsigned value.
This commit is contained in:
parent
29f1d12333
commit
7cb70ed6f3
@ -85,7 +85,7 @@ TEST_CASE("Test store_into(uint8_t), default value, non specified" *
|
|||||||
TEST_CASE("Test store_into(uint8_t), default value, specified" *
|
TEST_CASE("Test store_into(uint8_t), default value, specified" *
|
||||||
test_suite("store_into")) {
|
test_suite("store_into")) {
|
||||||
argparse::ArgumentParser program("test");
|
argparse::ArgumentParser program("test");
|
||||||
uint8_t res = -1;
|
uint8_t res = 55;
|
||||||
program.add_argument("--int-opt").default_value((uint8_t)3).store_into(res);
|
program.add_argument("--int-opt").default_value((uint8_t)3).store_into(res);
|
||||||
|
|
||||||
program.parse_args({"./test.exe", "--int-opt", "5"});
|
program.parse_args({"./test.exe", "--int-opt", "5"});
|
||||||
|
Loading…
Reference in New Issue
Block a user