Reject negative unsigned string values
This commit is contained in:
@@ -149,6 +149,7 @@ RENDER(Request& context)
|
||||
cfg["yes"] = "yes";
|
||||
cfg["no"] = "off";
|
||||
check("to_u64() / to_s64() / to_f64() / to_bool()", to_u64(cfg["u64"], 7) == 42 && to_u64(cfg["bad"], 7) == 7 && to_s64(cfg["s64"], 5) == -12 && to_s64(cfg["bad"], 5) == 5 && to_f64(cfg["f64"], 1.0) > 3.49 && to_f64(cfg["bad"], 1.25) == 1.25 && to_bool(cfg["yes"], false) && !to_bool(cfg["no"], true) && !to_bool("unknown", false), var_dump(cfg));
|
||||
check("to_u64() rejects negative and overflowing text", to_u64("-1", 7) == 7 && to_u64("+42", 7) == 42 && to_u64("18446744073709551615", 7) == 18446744073709551615ULL && to_u64("18446744073709551616", 7) == 7, std::to_string(to_u64("-1", 7)) + "/" + std::to_string(to_u64("18446744073709551616", 7)));
|
||||
|
||||
DValue perf = request_perf();
|
||||
u64 module_misses = perf["unit_module_cache_miss_count"].to_u64();
|
||||
|
||||
Reference in New Issue
Block a user