From c9522fb740200ccef6230cec452c48efb31e5394 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 11 May 2023 22:05:17 +0200 Subject: Removed all Printf-family functions from StringUtils. Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code. --- tests/BlockTypeRegistry/PalettedBlockAreaTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/BlockTypeRegistry') diff --git a/tests/BlockTypeRegistry/PalettedBlockAreaTest.cpp b/tests/BlockTypeRegistry/PalettedBlockAreaTest.cpp index ba4967b35..506d5ccf7 100644 --- a/tests/BlockTypeRegistry/PalettedBlockAreaTest.cpp +++ b/tests/BlockTypeRegistry/PalettedBlockAreaTest.cpp @@ -94,7 +94,7 @@ Used to be a function, but clang-3.5 didn't like it ("error: debug information f { \ for (int z = 0; z < 5; ++z) \ { \ - pbaA.setBlock({x, y, z}, Printf("A-%d-%d-%d", x, y, z), BlockState()); \ + pbaA.setBlock({x, y, z}, fmt::format(FMT_STRING("A-{}-{}-{}"), x, y, z), BlockState()); \ } \ } \ } \ @@ -105,7 +105,7 @@ Used to be a function, but clang-3.5 didn't like it ("error: debug information f { \ for (int z = 0; z < 6; ++z) \ { \ - pbaB.setBlock({x, y, z}, Printf("B-%d-%d-%d", x, y, z), BlockState()); \ + pbaB.setBlock({x, y, z}, fmt::format(FMT_STRING("B-{}-{}-{}"), x, y, z), BlockState()); \ } \ } \ } \ @@ -217,7 +217,7 @@ static void testPastingCompletelyInside() TEST_EQUAL_MSG( pbaA.block({x, y, z}).first, expected[z][y][x], - Printf("{%d, %d, %d}, exp %s, got %s", x, y, z, expected[z][y][x].c_str(), pbaA.block({x, y, z}).first.c_str()).c_str() + fmt::format(FMT_STRING("{{{}, {}, {}}}, exp {}, got {}"), x, y, z, expected[z][y][x], pbaA.block({x, y, z}).first) ); } } @@ -282,7 +282,7 @@ static void testPastingPositiveOverflow() TEST_EQUAL_MSG( pbaA.block({x, y, z}).first, expected[z][y][x], - Printf("{%d, %d, %d}, exp %s, got %s", x, y, z, expected[z][y][x].c_str(), pbaA.block({x, y, z}).first.c_str()).c_str() + fmt::format(FMT_STRING("{{{}, {}, {}}}, exp {}, got {}"), x, y, z, expected[z][y][x], pbaA.block({x, y, z}).first) ); } } @@ -347,7 +347,7 @@ static void testPastingNegativeOverflow() TEST_EQUAL_MSG( pbaA.block({x, y, z}).first, expected[z][y][x], - Printf("{%d, %d, %d}, exp %s, got %s", x, y, z, expected[z][y][x].c_str(), pbaA.block({x, y, z}).first.c_str()).c_str() + fmt::format(FMT_STRING("{{{}, {}, {}}}, exp {}, got {}"), x, y, z, expected[z][y][x], pbaA.block({x, y, z}).first) ); } } @@ -412,7 +412,7 @@ static void testPastingMixedOverflow() TEST_EQUAL_MSG( pbaA.block({x, y, z}).first, expected[z][y][x], - Printf("{%d, %d, %d}, exp %s, got %s", x, y, z, expected[z][y][x].c_str(), pbaA.block({x, y, z}).first.c_str()).c_str() + fmt::format(FMT_STRING("{{{}, {}, {}}}, exp {}, got {}"), x, y, z, expected[z][y][x], pbaA.block({x, y, z}).first) ); } } -- cgit v1.2.3