Skip to content

Commit

Permalink
[lldb] [test] Fix test_platform_file_fstat to account for negative ints
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mgorny committed Jun 20, 2022
1 parent a36b9b3 commit d3292c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d3292c4

Please sign in to comment.