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.
This commit is contained in:
Pokechu22 2023-01-12 12:39:20 -08:00
parent 92b6446da1
commit c681d96d46

View File

@ -64,22 +64,16 @@ public:
int count_a = a->RunVertices(src, buffer_a.data(), count); int count_a = a->RunVertices(src, buffer_a.data(), count);
int count_b = b->RunVertices(src, buffer_b.data(), count); int count_b = b->RunVertices(src, buffer_b.data(), count);
if (count_a != count_b) ASSERT_MSG(VIDEO, count_a == count_b,
{ "The two vertex loaders have loaded a different amount of vertices (a: {}, b: {}).",
ERROR_LOG_FMT( count_a, count_b);
VIDEO,
"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(), ASSERT_MSG(VIDEO,
std::min(count_a, count_b) * m_native_vtx_decl.stride)) memcmp(buffer_a.data(), buffer_b.data(),
{ std::min(count_a, count_b) * m_native_vtx_decl.stride) == 0,
ERROR_LOG_FMT(VIDEO, "The two vertex loaders have loaded different data. Configuration:"
"The two vertex loaders have loaded different data. Configuration:" "\nVertex desc:\n{}\n\nVertex attr:\n{}",
"\nVertex desc:\n{}\n\nVertex attr:\n{}", m_VtxDesc, m_VtxAttr);
m_VtxDesc, m_VtxAttr);
}
memcpy(dst, buffer_a.data(), count_a * m_native_vtx_decl.stride); memcpy(dst, buffer_a.data(), count_a * m_native_vtx_decl.stride);
m_numLoadedVertices += count; m_numLoadedVertices += count;