summaryrefslogtreecommitdiff
path: root/test/utils_str.c
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-11-10 17:10:57 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-11 18:37:36 +0000
commite2dfdb09d970143b521a9c6f316ebe09159988ed (patch)
tree02fc659853834812b28387060aed74e0ad722bdb /test/utils_str.c
parent737d4205a62c4b70ad33a6fbd547f5cb3f2b888c (diff)
downloadchrome-ec-e2dfdb09d970143b521a9c6f316ebe09159988ed.tar.gz
tree: rename strtoul to strtoull since it is 64-bit
A long is 32-bit, but a long long is 64-bit. The function name should be strtoull if it is returning 64 bits of data. BRANCH=none BUG=b:172592963 TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'test/utils_str.c')
-rw-r--r--test/utils_str.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/test/utils_str.c b/test/utils_str.c
index 2a68f6c35f..c592f6100a 100644
--- a/test/utils_str.c
+++ b/test/utils_str.c
@@ -99,59 +99,59 @@ static int test_strtoi(void)
return EC_SUCCESS;
}
-static int test_strtoul(void)
+static int test_strtoull(void)
{
char *e;
- TEST_ASSERT(strtoul("10", &e, 0) == 10);
+ TEST_ASSERT(strtoull("10", &e, 0) == 10);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("010", &e, 0) == 8);
+ TEST_ASSERT(strtoull("010", &e, 0) == 8);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+010", &e, 0) == 8);
+ TEST_ASSERT(strtoull("+010", &e, 0) == 8);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-010", &e, 0) == 0);
+ TEST_ASSERT(strtoull("-010", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0x1f z", &e, 0) == 31);
+ TEST_ASSERT(strtoull("0x1f z", &e, 0) == 31);
TEST_ASSERT(e && (*e == ' '));
- TEST_ASSERT(strtoul("0X1f z", &e, 0) == 31);
+ TEST_ASSERT(strtoull("0X1f z", &e, 0) == 31);
TEST_ASSERT(e && (*e == ' '));
- TEST_ASSERT(strtoul("10a", &e, 16) == 266);
+ TEST_ASSERT(strtoull("10a", &e, 16) == 266);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("0x02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("0x02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0x02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("+0x02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0x02C", &e, 16) == 0);
+ TEST_ASSERT(strtoull("-0x02C", &e, 16) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0x02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("0x02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0x02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("+0x02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0x02C", &e, 0) == 0);
+ TEST_ASSERT(strtoull("-0x02C", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0X02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("0X02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0X02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("+0X02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0X02C", &e, 16) == 0);
+ TEST_ASSERT(strtoull("-0X02C", &e, 16) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0X02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("0X02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0X02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("+0X02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0X02C", &e, 0) == 0);
+ TEST_ASSERT(strtoull("-0X02C", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul(" -12", &e, 0) == 0);
+ TEST_ASSERT(strtoull(" -12", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+0!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+0!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+0x!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+0x!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+0X!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+0X!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
return EC_SUCCESS;
@@ -268,7 +268,7 @@ void run_test(int argc, char **argv)
RUN_TEST(test_isprint);
RUN_TEST(test_strstr);
RUN_TEST(test_strtoi);
- RUN_TEST(test_strtoul);
+ RUN_TEST(test_strtoull);
RUN_TEST(test_parse_bool);
RUN_TEST(test_strzcpy);
RUN_TEST(test_strncpy);