Don't store -1 into unsigned value.

This commit is contained in:
Andrew Bell 2024-04-18 18:11:07 -04:00
parent 29f1d12333
commit 7cb70ed6f3

View File

@ -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"});