summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2025-03-20 17:11:46 +0100
committerj-p <jp_bruyere@hotmail.com>2025-03-24 19:12:00 +0100
commitcb034659a6b6f9bd3a4fa1511958e6ef947ccd54 (patch)
treeca519604a93c29819b4667ad91899b822ebc5da2
parent6fc9877b8a0e9b18d8afbcdadad1746dd0d4b31a (diff)
c_str char* cast
-rw-r--r--gunit_tests/drawTestBase.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gunit_tests/drawTestBase.cpp b/gunit_tests/drawTestBase.cpp
index 71a022c..9fc021f 100644
--- a/gunit_tests/drawTestBase.cpp
+++ b/gunit_tests/drawTestBase.cpp
@@ -35,7 +35,7 @@ void DrawTestBase::compareWithRefImage() {
if (fs::exists(targetPath)) {
int w = 0, h = 0, channels = 0;
- unsigned char *refImg = stbi_load(targetPath.c_str(), &w, &h, &channels, 4); // force 4 components per pixel
+ unsigned char *refImg = stbi_load((char*)targetPath.c_str(), &w, &h, &channels, 4); // force 4 components per pixel
EXPECT_TRUE(refImg != nullptr) << "Could not load image from " << targetPath << stbi_failure_reason();
EXPECT_EQ(vkvg_surface_get_width(surf),w);
EXPECT_EQ(vkvg_surface_get_height(surf),h);
@@ -67,13 +67,13 @@ void DrawTestBase::compareWithRefImage() {
if (totDiff > 0) {
fs::path diffPath = diffDir / ::testing::UnitTest::GetInstance()->current_test_info()->name();
targetPath.replace_extension(".png");
- stbi_write_png(diffPath.c_str(), (int32_t)w, (int32_t)h, 4, diffImg, (int32_t)(4 * w));
+ stbi_write_png((char*)diffPath.c_str(), (int32_t)w, (int32_t)h, 4, diffImg, (int32_t)(4 * w));
}
free(img);
free(diffImg);
} else {
- vkvg_status_t result = vkvg_surface_write_to_png(surf, targetPath.c_str());
+ vkvg_status_t result = vkvg_surface_write_to_png(surf, (char*)targetPath.c_str());
EXPECT_EQ(result, VKVG_STATUS_SUCCESS);
GTEST_SKIP() << "Updating reference image: " << targetPath;
}