From e791f4fce275247a66eb657ff7cc7be4ffd4d5bc Mon Sep 17 00:00:00 2001 From: Micky Date: Sun, 20 Nov 2022 12:29:50 +0100 Subject: Double precision of `String.split_floats` --- tests/core/string/test_string.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/core') diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index 7e4e3aa9f0..ebb526b37c 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -516,21 +516,22 @@ TEST_CASE("[String] Splitting") { s = "1.2;2.3 4.5"; const double slices_d[3] = { 1.2, 2.3, 4.5 }; - Vector f; - f = s.split_floats(";"); - CHECK(f.size() == 2); - for (int i = 0; i < f.size(); i++) { - CHECK(ABS(f[i] - slices_d[i]) <= 0.00001); + Vector d_arr; + d_arr = s.split_floats(";"); + CHECK(d_arr.size() == 2); + for (int i = 0; i < d_arr.size(); i++) { + CHECK(ABS(d_arr[i] - slices_d[i]) <= 0.00001); } Vector keys; keys.push_back(";"); keys.push_back(" "); - f = s.split_floats_mk(keys); - CHECK(f.size() == 3); - for (int i = 0; i < f.size(); i++) { - CHECK(ABS(f[i] - slices_d[i]) <= 0.00001); + Vector f_arr; + f_arr = s.split_floats_mk(keys); + CHECK(f_arr.size() == 3); + for (int i = 0; i < f_arr.size(); i++) { + CHECK(ABS(f_arr[i] - slices_d[i]) <= 0.00001); } s = "1;2 4"; -- cgit v1.2.3