Author: Michał Górny Date: 2022-06-20T19:42:22+02:00 New Revision: d3292c4ba0ce13edb316d7fb63ccae376081a102
URL: https://github.com/llvm/llvm-project/commit/d3292c4ba0ce13edb316d7fb63ccae376081a102 DIFF: https://github.com/llvm/llvm-project/commit/d3292c4ba0ce13edb316d7fb63ccae376081a102.diff LOG: [lldb] [test] Fix test_platform_file_fstat to account for negative ints Fix test_platform_file_fstat to correctly truncate/max out the expected value when GDB Remote Serial Protocol specifies a value as an unsigned integer but the underlying platform type uses a signed integer. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D128042 Added: Modified: lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py Removed: ################################################################################ diff --git a/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py b/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py index 57b2daf96143..fec1e95fa28c 100644 --- a/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py +++ b/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py @@ -32,11 +32,11 @@ class GDBStat(typing.NamedTuple): def uint32_or_zero(x): - return x if x < 2**32 else 0 + return x if x < 2**32 and x >= 0 else 0 def uint32_or_max(x): - return x if x < 2**32 else 2**32 - 1 + return x if x < 2**32 and x >= 0 else 2**32 - 1 def uint32_trunc(x): _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits