Skip to content

Commit

Permalink
[lldb] Fixed the TestGdbRemotePlatformFile test running on a remote t…
Browse files Browse the repository at this point in the history
…arget (#93832)

Skip checking of few stat fields like st_dev (ID of device containing
file) in case of a remote target.
  • Loading branch information
slydiman authored May 30, 2024
1 parent 59e2a6b commit b62ba7f
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,26 @@ def test_platform_file_fstat(self):
)
sys_stat = os.fstat(temp_file.fileno())

self.assertEqual(gdb_stat.st_dev, uint32_or_zero(sys_stat.st_dev))
self.assertEqual(gdb_stat.st_ino, uint32_or_zero(sys_stat.st_ino))
self.assertEqual(gdb_stat.st_mode, uint32_trunc(sys_stat.st_mode))
self.assertEqual(gdb_stat.st_nlink, uint32_or_max(sys_stat.st_nlink))
self.assertEqual(gdb_stat.st_uid, uint32_or_zero(sys_stat.st_uid))
self.assertEqual(gdb_stat.st_gid, uint32_or_zero(sys_stat.st_gid))
self.assertEqual(gdb_stat.st_rdev, uint32_or_zero(sys_stat.st_rdev))
self.assertEqual(gdb_stat.st_size, sys_stat.st_size)
self.assertEqual(gdb_stat.st_blksize, sys_stat.st_blksize)
self.assertEqual(gdb_stat.st_blocks, sys_stat.st_blocks)
self.assertEqual(gdb_stat.st_atime, uint32_or_zero(int(sys_stat.st_atime)))
self.assertEqual(gdb_stat.st_mtime, uint32_or_zero(int(sys_stat.st_mtime)))
self.assertEqual(gdb_stat.st_ctime, uint32_or_zero(int(sys_stat.st_ctime)))
if not lldb.remote_platform:
self.assertEqual(gdb_stat.st_dev, uint32_or_zero(sys_stat.st_dev))
self.assertEqual(gdb_stat.st_ino, uint32_or_zero(sys_stat.st_ino))
self.assertEqual(gdb_stat.st_uid, uint32_or_zero(sys_stat.st_uid))
self.assertEqual(gdb_stat.st_gid, uint32_or_zero(sys_stat.st_gid))
self.assertEqual(gdb_stat.st_blksize, sys_stat.st_blksize)
self.assertEqual(gdb_stat.st_blocks, sys_stat.st_blocks)
self.assertEqual(
gdb_stat.st_atime, uint32_or_zero(int(sys_stat.st_atime))
)
self.assertEqual(
gdb_stat.st_mtime, uint32_or_zero(int(sys_stat.st_mtime))
)
self.assertEqual(
gdb_stat.st_ctime, uint32_or_zero(int(sys_stat.st_ctime))
)

self.reset_test_sequence()
self.test_sequence.add_log_lines(
Expand Down

0 comments on commit b62ba7f

Please sign in to comment.