qt5base-lts/tests/auto/corelib
Thiago Macieira 7ca82250e0 tst_QFile: update virtualFile() to check if readLine() reads all
We know that all lines from /proc/<PID>/maps end in a newline, so we
trim exactly that one byte, then we put it all back together with
.join('\n') to check if we've read the entire file.

Linux virtual files are usually served in 4 kB increments; tst_qfile's
maps file is about 16000 bytes for me, just short of the QIODevice buffer:

[pid 414315] read(5, "55c6afe04000-55c6afe11000 r--p 0"..., 16384) = 4049
[pid 414315] read(5, "7f215fd25000-7f215fd26000 r--p 0"..., 12335) = 4038
[pid 414315] read(5, "7f2160800000-7f21608c7000 r--p 0"..., 8297) = 4072
[pid 414315] read(5, "7f216119f000-7f21611a0000 rw-p 0"..., 4225) = 3994

It is not a coincidence that the reads are at line boundaries, though
it's not a guarantee from the kernel.

We appear to have accidentally fixed the QEMU emulation bug by reading
another process' /proc/<PID>/maps (hypothesis: QMU emulates the target
system in /proc/self, hiding itself in maps, but makes no translation
for other process map files.

Change-Id: Ifbf974a4d10745b099b1fffd1777ac919b12dc90
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-25 22:54:08 +00:00
..
animation tst_QParallelAnimationGroup: fix memleak 2023-07-14 14:56:03 +02:00
global Mark all of Qt as free of Q_FOREACH, except where it isn't 2023-08-19 05:19:42 +00:00
io tst_QFile: update virtualFile() to check if readLine() reads all 2023-08-25 22:54:08 +00:00
ipc QNativeIpcKey: add qHash() function 2023-07-25 12:31:04 +02:00
itemmodels tst_QSortFilterProxyModel: fix mem-leaks II: sortStable() 2023-07-19 04:51:26 +00:00
kernel invokeMethod: Try invoking functor and member function accepting pointer, returning void 2023-08-24 07:45:04 +02:00
mimetypes tst_qmimedatabase: compile with QT_NO_FOREACH; port to ranged-for 2023-08-19 19:17:17 +03:00
platform CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
plugin QUuid: convert bswap(Id128Bytes) to a hidden friend of Id128Bytes 2023-08-18 18:00:09 +02:00
serialization Rename accent color in QPalette 2023-08-18 00:38:38 +02:00
text QString/QByteArray: fix append() wrt. raw data 2023-08-21 23:27:56 +02:00
thread Mark all of Qt as free of Q_FOREACH, except where it isn't 2023-08-19 05:19:42 +00:00
time Update QTimeZone data to CLDR v43 2023-08-07 19:51:09 +02:00
tools tst_QFreeList: build with QT_NO_FOREACH 2023-08-19 16:29:54 +03:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00