Skip to content

Commit d3292c4

Browse files
committed
[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
1 parent a36b9b3 commit d3292c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ class GDBStat(typing.NamedTuple):
3232

3333

3434
def uint32_or_zero(x):
35-
return x if x < 2**32 else 0
35+
return x if x < 2**32 and x >= 0 else 0
3636

3737

3838
def uint32_or_max(x):
39-
return x if x < 2**32 else 2**32 - 1
39+
return x if x < 2**32 and x >= 0 else 2**32 - 1
4040

4141

4242
def uint32_trunc(x):

0 commit comments

Comments
 (0)