aboutsummaryrefslogtreecommitdiff
path: root/test/str_ut.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:38 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commite6951139c0544116330b12e287fe45e30bbab11c (patch)
tree15216d11d6890cd497b6a97176c7aad4c4d63ecf /test/str_ut.c
parent5f4b356121fdb520e4c9bb4fe3483c1a5f93439c (diff)
downloadu-boot-e6951139c0544116330b12e287fe45e30bbab11c.zip
u-boot-e6951139c0544116330b12e287fe45e30bbab11c.tar.gz
u-boot-e6951139c0544116330b12e287fe45e30bbab11c.tar.bz2
lib: Allow using 0x when a decimal value is requested
U-Boot mostly uses hex for value input, largely because addresses are much easier to understand in hex. But in some cases a decimal value is requested, such as where the value is small or hex does not make sense in the context. In these cases it is sometimes useful to be able to provide a hex value in any case, if only to resolve any ambiguity. Add this functionality, for increased flexibility. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/str_ut.c')
-rw-r--r--test/str_ut.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/str_ut.c b/test/str_ut.c
index 0d1bf39..d2840d5 100644
--- a/test/str_ut.c
+++ b/test/str_ut.c
@@ -89,7 +89,7 @@ static int str_simple_strtoul(struct unit_test_state *uts)
ut_assertok(run_strtoul(uts, str2, 10, 1099, 4, upper));
ut_assertok(run_strtoul(uts, str2, 16, 0x1099ab, 6, upper));
ut_assertok(run_strtoul(uts, str3, 16, 0xb, 3, upper));
- ut_assertok(run_strtoul(uts, str3, 10, 0, 1, upper));
+ ut_assertok(run_strtoul(uts, str3, 10, 0xb, 3, upper));
/* Octal */
ut_assertok(run_strtoul(uts, str6, 0, 63, 3, upper));
@@ -144,7 +144,7 @@ static int str_simple_strtoull(struct unit_test_state *uts)
ut_assertok(run_strtoull(uts, str2, 10, 1099, 4, upper));
ut_assertok(run_strtoull(uts, str2, 16, 0x1099ab, 6, upper));
ut_assertok(run_strtoull(uts, str3, 16, 0xb, 3, upper));
- ut_assertok(run_strtoull(uts, str3, 10, 0, 1, upper));
+ ut_assertok(run_strtoull(uts, str3, 10, 0xb, 3, upper));
/* Octal */
ut_assertok(run_strtoull(uts, str6, 0, 63, 3, upper));