mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
src/test: add tests for parse_percent_unbounded (#3889)
This commit is contained in:
parent
5124866d73
commit
1898a1a5c3
@ -493,6 +493,11 @@ static void test_parse_percent(void) {
|
||||
assert_se(parse_percent("1%%") == -EINVAL);
|
||||
}
|
||||
|
||||
static void test_parse_percent_unbounded(void) {
|
||||
assert_se(parse_percent_unbounded("101%") == 101);
|
||||
assert_se(parse_percent_unbounded("400%") == 400);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
@ -507,6 +512,7 @@ int main(int argc, char *argv[]) {
|
||||
test_safe_atoi16();
|
||||
test_safe_atod();
|
||||
test_parse_percent();
|
||||
test_parse_percent_unbounded();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user