fix: update parse_float test to reflect accepted negatives
This commit is contained in:
parent
a1bb371d3a
commit
8e46db9d2e
1 changed files with 4 additions and 3 deletions
|
|
@ -39,13 +39,14 @@ Test(parse_float, empty_string)
|
||||||
cr_assert_eq(ret, 1);
|
cr_assert_eq(ret, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test 5: Negative number */
|
/* Test 5: Negative number (cli_parse_float accepts negatives; use cli_parse_ufloat to reject) */
|
||||||
Test(parse_float, negative_number)
|
Test(parse_float, negative_number)
|
||||||
{
|
{
|
||||||
float result;
|
float result;
|
||||||
int ret = cli_parse_float("-42", &result);
|
int ret = cli_parse_float("-42", &result);
|
||||||
|
|
||||||
cr_assert_eq(ret, 1);
|
cr_assert_eq(ret, 0);
|
||||||
|
cr_assert_float_eq(result, -42.0f, 0.0001f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test 6: Invalid characters */
|
/* Test 6: Invalid characters */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue