From c681d96d468eb63e8b322226c634eb72cdc10d01 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Thu, 12 Jan 2023 12:39:20 -0800 Subject: [PATCH] VertexLoaderTester: Use asserts instead of logs Logs don't show up in unit tests, and since this is debugging functionality (though not enabled for tests by default) it's better to do it this way. --- Source/Core/VideoCommon/VertexLoaderBase.cpp | 24 ++++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp index dae75ddd6a..e8b38ba345 100644 --- a/Source/Core/VideoCommon/VertexLoaderBase.cpp +++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp @@ -64,22 +64,16 @@ public: int count_a = a->RunVertices(src, buffer_a.data(), count); int count_b = b->RunVertices(src, buffer_b.data(), count); - if (count_a != count_b) - { - ERROR_LOG_FMT( - VIDEO, - "The two vertex loaders have loaded a different amount of vertices (a: {}, b: {}).", - count_a, count_b); - } + ASSERT_MSG(VIDEO, count_a == count_b, + "The two vertex loaders have loaded a different amount of vertices (a: {}, b: {}).", + count_a, count_b); - if (memcmp(buffer_a.data(), buffer_b.data(), - std::min(count_a, count_b) * m_native_vtx_decl.stride)) - { - ERROR_LOG_FMT(VIDEO, - "The two vertex loaders have loaded different data. Configuration:" - "\nVertex desc:\n{}\n\nVertex attr:\n{}", - m_VtxDesc, m_VtxAttr); - } + ASSERT_MSG(VIDEO, + memcmp(buffer_a.data(), buffer_b.data(), + std::min(count_a, count_b) * m_native_vtx_decl.stride) == 0, + "The two vertex loaders have loaded different data. Configuration:" + "\nVertex desc:\n{}\n\nVertex attr:\n{}", + m_VtxDesc, m_VtxAttr); memcpy(dst, buffer_a.data(), count_a * m_native_vtx_decl.stride); m_numLoadedVertices += count;