From f9687ae5774f0701aaeabe55029c87d783408560 Mon Sep 17 00:00:00 2001 From: EmilDohne <86836589+EmilDohne@users.noreply.github.com> Date: Sun, 7 Jul 2024 20:43:22 +0200 Subject: [PATCH] add debug logging as well as fixing further warnings --- .../src/LayeredFile/Util/GenerateLayerMaskInfo.cpp | 1 + PhotoshopTest/src/TestMacros.h | 2 +- .../TestPredictionEncodeRoundtrip.cpp | 12 ++++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/PhotoshopAPI/src/LayeredFile/Util/GenerateLayerMaskInfo.cpp b/PhotoshopAPI/src/LayeredFile/Util/GenerateLayerMaskInfo.cpp index 8c75c80..bb55ec2 100644 --- a/PhotoshopAPI/src/LayeredFile/Util/GenerateLayerMaskInfo.cpp +++ b/PhotoshopAPI/src/LayeredFile/Util/GenerateLayerMaskInfo.cpp @@ -20,6 +20,7 @@ template LayerAndMaskInformation generateLayerMaskInfo(LayeredFile& layeredFile, const FileHeader& header) { PSAPI_LOG_ERROR("LayeredFile", "Cannot construct layer and mask information section if type is not uint8_t, uint16_t or float32_t"); + return LayerAndMaskInformation(); } // --------------------------------------------------------------------------------------------------------------------- diff --git a/PhotoshopTest/src/TestMacros.h b/PhotoshopTest/src/TestMacros.h index 1bab006..caef4ca 100644 --- a/PhotoshopTest/src/TestMacros.h +++ b/PhotoshopTest/src/TestMacros.h @@ -21,4 +21,4 @@ if (x[i] != y[i]) { \ CHECK_MESSAGE(x[i] == y[i], "Failed vector index: ", i); return;\ } \ - } \ No newline at end of file + } diff --git a/PhotoshopTest/src/TestPredictionEncode/TestPredictionEncodeRoundtrip.cpp b/PhotoshopTest/src/TestPredictionEncode/TestPredictionEncodeRoundtrip.cpp index 4970271..184d2a5 100644 --- a/PhotoshopTest/src/TestPredictionEncode/TestPredictionEncodeRoundtrip.cpp +++ b/PhotoshopTest/src/TestPredictionEncode/TestPredictionEncodeRoundtrip.cpp @@ -1,6 +1,7 @@ #include "doctest.h" #include "Macros.h" +#include "../TestMacros.h" #include "Core/Compression/Compress_ZIP.h" #include "Core/Compression/Decompress_ZIP.h" @@ -93,9 +94,16 @@ TEST_CASE("Prediction Roundtrip Flat Channel 32-bit") std::vector dataExpected = channel; NAMESPACE_PSAPI::ZIP_Impl::PredictionEncode(channel, buffer, width, height); + for (int y = 0; y < height; ++y) + { + for (int x = 0; x < width; ++x) + { + std::cout << "Y: " << y << "X:" << x << channel[y * width + x] << std::endl; + } + } NAMESPACE_PSAPI::ZIP_Impl::RemovePredictionEncoding(channel, width, height); - CHECK(channel == dataExpected); + CHECK_VEC_VERBOSE(channel, dataExpected); } @@ -113,5 +121,5 @@ TEST_CASE("Prediction Roundtrip Large Channel 32-bit") NAMESPACE_PSAPI::ZIP_Impl::PredictionEncode(channel, buffer, width, height); NAMESPACE_PSAPI::ZIP_Impl::RemovePredictionEncoding(channel, width, height); - CHECK(channel == dataExpected); + CHECK_VEC_VERBOSE(channel, dataExpected); }