From 68634d8982b0650892939a568de272b9d11cb9fc Mon Sep 17 00:00:00 2001 From: Elyashiv Cohen Date: Sun, 17 Dec 2023 10:51:54 +0200 Subject: [PATCH] tests: Fix expected value after test_and_set atomic op [ Upstream commit c4f1885b428438b36a2fcae8ea389e6c81f4ef09 ] The expected behaviour of test_and_set is to set the memory to 0x1 and not ffs as implemented in the relevant tests. Fixes: 19e132ebfc5e ("tests: Add tests for mlx5 MEMIC atomic operations") Signed-off-by: Elyashiv Cohen Signed-off-by: Edward Srouji Signed-off-by: Nicolas Morey --- tests/test_mlx5_dm_ops.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_mlx5_dm_ops.py b/tests/test_mlx5_dm_ops.py index b748a8af0..75a919b85 100644 --- a/tests/test_mlx5_dm_ops.py +++ b/tests/test_mlx5_dm_ops.py @@ -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) @@ -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})' )