Skip to content

Commit

Permalink
add debug logging as well as fixing further warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilDohne committed Jul 7, 2024
1 parent 765311e commit f9687ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ template <typename T>
LayerAndMaskInformation generateLayerMaskInfo(LayeredFile<T>& 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();
}

// ---------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion PhotoshopTest/src/TestMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
if (x[i] != y[i]) { \
CHECK_MESSAGE(x[i] == y[i], "Failed vector index: ", i); return;\
} \
}
}
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -93,9 +94,16 @@ TEST_CASE("Prediction Roundtrip Flat Channel 32-bit")
std::vector<float32_t> 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<float32_t>(channel, width, height);

CHECK(channel == dataExpected);
CHECK_VEC_VERBOSE(channel, dataExpected);
}


Expand All @@ -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<float32_t>(channel, width, height);

CHECK(channel == dataExpected);
CHECK_VEC_VERBOSE(channel, dataExpected);
}

0 comments on commit f9687ae

Please sign in to comment.