summaryrefslogtreecommitdiff
path: root/main/tests/test_string.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-07-05 11:36:24 +0200
committerGitHub <noreply@github.com>2020-07-05 11:36:24 +0200
commit0287508dcdf51c7349b41aabb7679061a5147fdf (patch)
treef46a2a7746edacfc4fee599d13b2a5cd57eee606 /main/tests/test_string.cpp
parent17f5ebc4e85b76ca780c332ecb657132f28e704d (diff)
parent5c21732da1a2c71af302a939d98d1583af28a410 (diff)
Merge pull request #40130 from aaronfranke/mingw-sucks
Fix string test code for MinGW
Diffstat (limited to 'main/tests/test_string.cpp')
-rw-r--r--main/tests/test_string.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp
index 5a14492be5..73d59b0088 100644
--- a/main/tests/test_string.cpp
+++ b/main/tests/test_string.cpp
@@ -370,8 +370,11 @@ bool test_22() {
static const int num[4] = { 1237461283, -22, 0, -1123412 };
for (int i = 0; i < 4; i++) {
+#ifdef __MINGW32__ // MinGW can't handle normal format specifiers for some reason. So we need special code just for MinGW.
+ OS::get_singleton()->print("\tString: \"%s\" as Int is %I64i\n", nums[i], (long long)(String(nums[i]).to_int()));
+#else
OS::get_singleton()->print("\tString: \"%s\" as Int is %lli\n", nums[i], (long long)(String(nums[i]).to_int()));
-
+#endif
if (String(nums[i]).to_int() != num[i]) {
return false;
}