summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-11-20 12:29:50 +0100
committerMicky <micheledevita2@gmail.com>2022-11-20 12:29:50 +0100
commite791f4fce275247a66eb657ff7cc7be4ffd4d5bc (patch)
tree00b1015cdb150ca4277c47f665a630cbb73c0ca9 /tests
parent8aafcf9d2ae43e83636d60dbfd5f10e50fcdb324 (diff)
Double precision of `String.split_floats`
Diffstat (limited to 'tests')
-rw-r--r--tests/core/string/test_string.h19
1 files changed, 10 insertions, 9 deletions
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<float> 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<double> 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<String> 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<float> 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";