File: 32bit_selftest_fix.patch

package info (click to toggle)
icu 78.2-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 123,988 kB
  • sloc: cpp: 527,891; ansic: 112,789; sh: 4,983; makefile: 4,657; perl: 3,199; python: 2,933; xml: 749; sed: 36; lisp: 12
file content (29 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: fix 32 bit self-testing
 Upstream uses a too big 16 bit character array to fit on 32 bit
 architectures. Half the size of the array on such machines.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Forwarded: no
Last-Update: 2025-08-23

---

--- icu-77.1.orig/source/test/intltest/ustrtest.cpp
+++ icu-77.1/source/test/intltest/ustrtest.cpp
@@ -2378,7 +2378,17 @@ void UnicodeStringTest::TestLargeMemory(
 #if U_PLATFORM_IS_LINUX_BASED || U_PLATFORM_IS_DARWIN_BASED
     if(quick) { return; }
     IcuTestErrorCode status(*this, "TestLargeMemory");
+#if defined(__i386__) || defined(__arm__) || defined(__hppa__) || defined(__powerpc__)
+    constexpr uint32_t len = 1073741820;
+#else
+
+#if defined (__x86_64__) && SIZE_MAX == 0xFFFFFFFF
+    constexpr uint32_t len = 1073741820;
+#else
     constexpr uint32_t len = 2147483643;
+#endif
+
+#endif
     char16_t *buf = new char16_t[len];
     if (buf == nullptr) { return; }
     uprv_memset(buf, 0x4e, len * 2);