add another case to str_to_number tests

Tue, 11 Feb 2025 19:37:53 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 11 Feb 2025 19:37:53 +0100
changeset 1184
34d60b1664f2
parent 1183
86d386c0cf75
child 1185
d825aca193d3

add another case to str_to_number tests

tests/test_string.c file | annotate | diff | comparison | revisions
--- a/tests/test_string.c	Tue Feb 11 19:31:01 2025 +0100
+++ b/tests/test_string.c	Tue Feb 11 19:37:53 2025 +0100
@@ -1003,6 +1003,7 @@
     int64_t i64;
     CX_TEST_DO {
         // do some brute force tests with all ranges
+        test_strtoint_rollout_signed(5, 10);
         test_strtoint_rollout_signed(47, 10);
         test_strtoint_rollout_signed(210, 10);
         test_strtoint_rollout_signed(5678, 10);
@@ -1119,6 +1120,10 @@
         // do some special case tests
         // --------------------------
 
+        // leading plus
+        CX_TEST_ASSERT(0 == cx_strtou32(cx_str("+5"), &u32, 10));
+        CX_TEST_ASSERT(u32 == 5);
+
         // group separators
         CX_TEST_ASSERT(0 == cx_strtou32(cx_str("123,456"), &u32, 10));
         CX_TEST_ASSERT(u32 == 123456);

mercurial