leginee opened a new pull request, #487: URL: https://github.com/apache/openoffice/pull/487
This PR is the second out of 3 fixes from test migration. They failed on the 32bit system because they did not have a 64 bit guard and behaved incorrect in the windows 32 bit build. Added guards to ensure correct behaviour. This is based on AI generation better have multiple eyes review the code. # commit message for conveniance test_t_abs64 used bare 2147483648 literals whose width is implementation-defined: 32-bit on ILP32/LLP64 (win32), 64-bit on LP64. "2147483648 << 1" and "* 2" therefore overflowed to 0 in 32-bit arithmetic before being widened to sal_Int64, so the n != 0 assertions failed. Latent on 64-bit Linux, surfaced on the win32 test migration. - test1/test2: force 64-bit operands (sal_Int64(...)), matching the already-correct test1_1 idiom; test0 (the deliberate 32-bit narrowing overflow demo) is left untouched. - t_abs64 printf: %ld -> SAL_PRIdINT64 (wrong wherever long is 32-bit). - Replace weak "> 0" / "!= 0" checks with exact-value assertions written as independent constants, so a regression to 32-bit arithmetic is actually caught. - Add test_abs64_range: exercises 0, +/-1, +/-SAL_MAX_INT64 exactly and documents the SAL_MIN_INT64 two's-complement boundary. Test-only, C++98, platform-neutral; no shipping source touched. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
