linux/tools/testing/selftests/iommu
Robin Murphy 9859418194 iommufd/selftest: Fix _test_mock_dirty_bitmaps()
The ASSERT_EQ() macro sneakily expands to two statements, so the loop here
needs braces to ensure it captures both and actually terminates the test
upon failure. Where these tests are currently failing on my arm64 machine,
this reduces the number of logged lines from a rather unreasonable
~197,000 down to 10. While we're at it, we can also clean up the
tautologous "count" calculations whose assertions can never fail unless
mathematics and/or the C language become fundamentally broken.

Fixes: a9af47e382 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Link: https://lore.kernel.org/r/90e083045243ef407dd592bb1deec89cd1f4ddf2.1700153535.git.robin.murphy@arm.com
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Tested-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2023-11-20 21:29:31 -04:00
..
.gitignore iommufd: Add a selftest 2022-11-30 20:16:49 -04:00
config iommufd: Add a selftest 2022-11-30 20:16:49 -04:00
iommufd_fail_nth.c iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs 2023-10-26 11:15:57 -03:00
iommufd_utils.h iommufd/selftest: Fix _test_mock_dirty_bitmaps() 2023-11-20 21:29:31 -04:00
iommufd.c iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs 2023-10-26 11:15:57 -03:00
Makefile selftests: iommu: Use installed kernel headers search path 2023-02-13 09:09:46 -07:00