Replace ties with structured bindings - UnitTests

This commit is contained in:
Dr. Dystopia 2024-08-19 08:32:45 +02:00
parent 4ff5ff2772
commit 096ab8c026

View File

@ -130,11 +130,7 @@ INSTANTIATE_TEST_SUITE_P(
TEST_P(VertexLoaderParamTest, PositionAll) TEST_P(VertexLoaderParamTest, PositionAll)
{ {
VertexComponentFormat addr; auto [addr, format, elements, frac] = GetParam();
ComponentFormat format;
CoordComponentCount elements;
int frac;
std::tie(addr, format, elements, frac) = GetParam();
this->m_vtx_desc.low.Position = addr; this->m_vtx_desc.low.Position = addr;
this->m_vtx_attr.g0.PosFormat = format; this->m_vtx_attr.g0.PosFormat = format;
this->m_vtx_attr.g0.PosElements = elements; this->m_vtx_attr.g0.PosElements = elements;
@ -278,9 +274,7 @@ INSTANTIATE_TEST_SUITE_P(
TEST_P(VertexLoaderSpeedTest, PositionDirectAll) TEST_P(VertexLoaderSpeedTest, PositionDirectAll)
{ {
ComponentFormat format; auto [format, elements_i] = GetParam();
int elements_i;
std::tie(format, elements_i) = GetParam();
CoordComponentCount elements = static_cast<CoordComponentCount>(elements_i); CoordComponentCount elements = static_cast<CoordComponentCount>(elements_i);
fmt::print("format: {}, elements: {}\n", format, elements); fmt::print("format: {}, elements: {}\n", format, elements);
const u32 elem_count = elements == CoordComponentCount::XY ? 2 : 3; const u32 elem_count = elements == CoordComponentCount::XY ? 2 : 3;
@ -295,9 +289,7 @@ TEST_P(VertexLoaderSpeedTest, PositionDirectAll)
TEST_P(VertexLoaderSpeedTest, TexCoordSingleElement) TEST_P(VertexLoaderSpeedTest, TexCoordSingleElement)
{ {
ComponentFormat format; auto [format, elements_i] = GetParam();
int elements_i;
std::tie(format, elements_i) = GetParam();
TexComponentCount elements = static_cast<TexComponentCount>(elements_i); TexComponentCount elements = static_cast<TexComponentCount>(elements_i);
fmt::print("format: {}, elements: {}\n", format, elements); fmt::print("format: {}, elements: {}\n", format, elements);
const u32 elem_count = elements == TexComponentCount::S ? 1 : 2; const u32 elem_count = elements == TexComponentCount::S ? 1 : 2;
@ -561,11 +553,7 @@ INSTANTIATE_TEST_SUITE_P(
TEST_P(VertexLoaderNormalTest, NormalAll) TEST_P(VertexLoaderNormalTest, NormalAll)
{ {
VertexComponentFormat addr; auto [addr, format, elements, index3] = GetParam();
ComponentFormat format;
NormalComponentCount elements;
bool index3;
std::tie(addr, format, elements, index3) = GetParam();
m_vtx_desc.low.Position = VertexComponentFormat::Direct; m_vtx_desc.low.Position = VertexComponentFormat::Direct;
m_vtx_attr.g0.PosFormat = ComponentFormat::Float; m_vtx_attr.g0.PosFormat = ComponentFormat::Float;
@ -783,8 +771,7 @@ INSTANTIATE_TEST_SUITE_P(AllCombinations, VertexLoaderSkippedColorsTest,
TEST_P(VertexLoaderSkippedColorsTest, SkippedColors) TEST_P(VertexLoaderSkippedColorsTest, SkippedColors)
{ {
bool enable_color_0, enable_color_1; auto [enable_color_0, enable_color_1] = GetParam();
std::tie(enable_color_0, enable_color_1) = GetParam();
size_t input_size = 1; size_t input_size = 1;
size_t output_size = 3 * sizeof(float); size_t output_size = 3 * sizeof(float);