summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-01-28 07:39:05 -0500
committerAaron Franke <arnfranke@yahoo.com>2021-01-28 07:43:53 -0500
commita3e3bf822761c477d3a297fe004496ffc6c7b10d (patch)
tree60b1748d82a703388947294d927fde87534286b6 /tests
parent726967f45318359d95e3b0c359e088ca6d430292 (diff)
Make hex_to_int and bin_to_int handle the prefix automatically
Also add BinToInt to C#
Diffstat (limited to 'tests')
-rw-r--r--tests/test_string.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/test_string.h b/tests/test_string.h
index 1fb6de5299..6fde11685c 100644
--- a/tests/test_string.h
+++ b/tests/test_string.h
@@ -370,12 +370,9 @@ TEST_CASE("[String] String to integer") {
TEST_CASE("[String] Hex to integer") {
static const char *nums[4] = { "0xFFAE", "22", "0", "AADDAD" };
static const int64_t num[4] = { 0xFFAE, 0x22, 0, 0xAADDAD };
- static const bool wo_prefix[4] = { false, true, true, true };
- static const bool w_prefix[4] = { true, false, true, false };
for (int i = 0; i < 4; i++) {
- CHECK((String(nums[i]).hex_to_int(true) == num[i]) == w_prefix[i]);
- CHECK((String(nums[i]).hex_to_int(false) == num[i]) == wo_prefix[i]);
+ CHECK(String(nums[i]).hex_to_int() == num[i]);
}
}