From 7385e6886218bd79c51f0a56cec2f3209cd98ff5 Mon Sep 17 00:00:00 2001 From: Hayden Laccabue Date: Tue, 14 Jan 2025 16:49:27 -0800 Subject: [PATCH] Refactoring umq df_bw xrt_test (#348) Signed-off-by: Hayden Laccabue --- test/xrt_test/xrt_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/xrt_test/xrt_test.cpp b/test/xrt_test/xrt_test.cpp index 8141369..2002f96 100644 --- a/test/xrt_test/xrt_test.cpp +++ b/test/xrt_test/xrt_test.cpp @@ -317,9 +317,9 @@ TEST_xrt_umq_df_bw(int device_index, arg_type& arg) xrt_bo bo_ifm{device, rw_size, xrt::bo::flags::cacheable}; xrt_bo bo_ofm{device, rw_size, xrt::bo::flags::cacheable}; - auto p = bo_ifm.map(); + auto ifm_mapped = bo_ifm.map(); for (uint32_t i = 0; i < rw_size / sizeof(uint32_t); i++) { - p[i] = data; + ifm_mapped[i] = data; } // Setting args for patching control code buffer @@ -335,11 +335,11 @@ TEST_xrt_umq_df_bw(int device_index, arg_type& arg) throw std::runtime_error(std::string("bad command state: ") + std::to_string(state)); // Check result - p = bo_ofm.map(); + auto ofm_mapped = bo_ofm.map(); int err = 0; for (uint32_t i = 0; i < rw_size / sizeof(uint32_t); i++) { - if (p[i] != 0) { - std::cout << "error@" << i <<": " << p[i] << ", expecting: " << 0 << std::endl; + if (ofm_mapped[i] != ifm_mapped[i]) { + std::cout << "error@" << i <<": " << ofm_mapped[i] << ", expecting: " << ifm_mapped[i] << std::endl; err++; } }