any1 / neatvnc

A liberally licensed VNC server library with a clean interface
ISC License
120 stars 30 forks source link

neatvnc 0.6.0 has failed test on big-endian architecture #94

Closed hosiet closed 1 year ago

hosiet commented 1 year ago

When building neatvnc on big-endian architecture (e.g., s390x with Debian), the test will fail. You may find related build log at https://buildd.debian.org/status/fetch.php?pkg=neatvnc&arch=s390x&ver=0.6.0%2Bdfsg-2&stamp=1690280283&raw=0 .

[24/26] cc -Itest/pixels.p -Itest -I../test -I../include -I/usr/include/pixman-1 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 '-DPROJECT_VERSION="0.6.0"' -D_GNU_SOURCE -fvisibility=hidden -DAML_UNSTABLE_API=1 -Wmissing-prototypes -Wno-unused-parameter -DNDEBUG -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -MD -MQ test/pixels.p/test-pixels.c.o -MF test/pixels.p/test-pixels.c.o.d -o test/pixels.p/test-pixels.c.o -c ../test/test-pixels.c
../test/test-pixels.c: In function ‘test_pixel32_to_cpixel_4bpp’:
../test/test-pixels.c:10:45: warning: result of ‘287454020 << 8’ requires 38 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   10 | #define swap32(x) (((x >> 24) & 0xff) | ((x << 8) & 0xff0000) | \
      |                                             ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:27:24: note: in expansion of macro ‘u32_le’
   27 |         uint32_t src = u32_le(0x11223344);
      |                        ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘287454020 << 24’ requires 54 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:27:24: note: in expansion of macro ‘u32_le’
   27 |         uint32_t src = u32_le(0x11223344);
      |                        ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘3351057 << 24’ requires 47 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:43:20: note: in expansion of macro ‘u32_le’
   43 |         if (dst != u32_le(0x00332211))
      |                    ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘1122867 << 24’ requires 46 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:49:20: note: in expansion of macro ‘u32_le’
   49 |         if (dst != u32_le(0x00112233))
      |                    ^~~~~~
../test/test-pixels.c:10:45: warning: result of ‘857870592 << 8’ requires 39 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   10 | #define swap32(x) (((x >> 24) & 0xff) | ((x << 8) & 0xff0000) | \
      |                                             ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:55:20: note: in expansion of macro ‘u32_le’
   55 |         if (dst != u32_le(0x33221100))
      |                    ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘857870592 << 24’ requires 55 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:55:20: note: in expansion of macro ‘u32_le’
   55 |         if (dst != u32_le(0x33221100))
      |                    ^~~~~~
../test/test-pixels.c: In function ‘test_extract_alpha_mask_rgba8888’:
../test/test-pixels.c:11:43: warning: result of ‘16711680 << 24’ requires 49 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:92:17: note: in expansion of macro ‘u32_le’
   92 |                 u32_le(0x00ff0000), // Red, transparent
      |                 ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘65280 << 24’ requires 41 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:93:17: note: in expansion of macro ‘u32_le’
   93 |                 u32_le(0x0000ff00), // Green, transparent
      |                 ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘16711935 << 24’ requires 49 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:96:17: note: in expansion of macro ‘u32_le’
   96 |                 u32_le(0x00ff00ff), // Red, opaque
      |                 ^~~~~~
../test/test-pixels.c:11:43: warning: result of ‘65535 << 24’ requires 41 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
   11 |                 ((x >> 8) & 0xff00) | ((x << 24) & 0xff000000))
      |                                           ^~
../test/test-pixels.c:16:19: note: in expansion of macro ‘swap32’
   16 | #define u32_le(x) swap32(x)
      |                   ^~~~~~
../test/test-pixels.c:97:17: note: in expansion of macro ‘u32_le’
   97 |                 u32_le(0x0000ffff), // Green, opaque
      |                 ^~~~~~
[25/26] cc -Itest/pixels.p -Itest -I../test -I../include -I/usr/include/pixman-1 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 '-DPROJECT_VERSION="0.6.0"' -D_GNU_SOURCE -fvisibility=hidden -DAML_UNSTABLE_API=1 -Wmissing-prototypes -Wno-unused-parameter -DNDEBUG -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -MD -MQ test/pixels.p/.._src_pixels.c.o -MF test/pixels.p/.._src_pixels.c.o.d -o test/pixels.p/.._src_pixels.c.o -c ../src/pixels.c
[26/26] cc  -o test/pixels test/pixels.p/test-pixels.c.o test/pixels.p/.._src_pixels.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,--start-group /usr/lib/s390x-linux-gnu/libpixman-1.so -Wl,--end-group
   dh_auto_test -a
    cd obj-s390x-linux-gnu && LC_ALL=C.UTF-8 MESON_TESTTHREADS=2 meson test
ninja: Entering directory `/<<PKGBUILDDIR>>/obj-s390x-linux-gnu'
ninja: no work to do.
1/1 pixels FAIL            0.00s   exit status 1
>>> MALLOC_PERTURB_=48 /<<PKGBUILDDIR>>/obj-s390x-linux-gnu/test/pixels

Ok:                 0   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   
any1 commented 1 year ago

Duplicates #85