Skip to content

Commit

Permalink
tests: Fix expected value after test_and_set atomic op
Browse files Browse the repository at this point in the history
[ Upstream commit c4f1885 ]

The expected behaviour of test_and_set is to set the memory to 0x1 and
not ffs as implemented in the relevant tests.

Fixes: 19e132e ("tests: Add tests for mlx5 MEMIC atomic operations")
Signed-off-by: Elyashiv Cohen <elyashivc@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
  • Loading branch information
Elyashiv Cohen authored and nmorey committed May 30, 2024
1 parent 8dfe8c1 commit 85568fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_mlx5_dm_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ def test_dm_atomic_ops(self):
raise ex
inc_addr.write(b'\x01')
inc_addr.write(b'\x01')
# Now we should read 0x02 and the memory set to ffs
# Now we should read 0x02 and the memory set to 0x1
val = int.from_bytes(test_and_set_addr.read(1), 'big')
self.assertEqual(val, 2)
# Verify that TEST_AND_SET set the memory to ffs
# Verify that TEST_AND_SET set the memory to 0x1
val = int.from_bytes(test_and_set_addr.read(1), 'big')
self.assertEqual(val, 255)
self.assertEqual(val, 1)
inc_addr.unmap(self.dm_size)
test_and_set_addr.unmap(self.dm_size)

Expand Down Expand Up @@ -146,5 +146,5 @@ def test_parallel_dm_atomic_ops(self):
raise self.skip_queue.get()

val = int.from_bytes(self._read_from_op_addr(), 'big')
self.assertEqual(val, num_threads - 1,
f'Read value is ({val}) is different than expected ({num_threads-1})' )
self.assertEqual(val, num_threads + 1,
f'Read value is ({val}) is different than expected ({num_threads+1})' )

0 comments on commit 85568fc

Please sign in to comment.