Pārlūkot izejas kodu

Merge pull request #40130 from aaronfranke/mingw-sucks

Fix string test code for MinGW
Rémi Verschelde 5 gadi atpakaļ
vecāks
revīzija
0287508dcd
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      main/tests/test_string.cpp

+ 4 - 1
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;
 		}