Skip to content

Commit

Permalink
Fix comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Dec 11, 2023
1 parent bde3f0a commit 152292e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ add_library(avif_obj OBJECT)
add_library(avif)

# Adds <target> to avif_obj's public link libraries for build, and adds
# the 'target' library as an install link library for export if a consumer
# the <target> library as an install link library for export if a consumer
# would need to include that library alongside libavif when linking.
function(avif_target_link_library target)
target_link_libraries(avif_obj PUBLIC $<BUILD_INTERFACE:${target}>)
Expand Down Expand Up @@ -626,7 +626,7 @@ if(AVIF_BUILD_APPS OR (AVIF_BUILD_TESTS AND (AVIF_ENABLE_FUZZTEST OR AVIF_ENABLE
apps/shared/avifutil.c apps/shared/iccmaker.c apps/shared/y4m.c third_party/iccjpeg/iccjpeg.c
)
# Instead of building avif_apps/avif_apps_internal and linking to avif/avif_internal, avif_apps_obj only does one compilation.
# Still, the definitions needs to be passed from avif to avif_apps. The following also passes them to avif_apps_internal but AVIF_DLL does not impact avif_apps_internal.
# Still, the compile definitions needs to be passed from avif to avif_apps. The following also passes them to avif_apps_internal but AVIF_DLL does not impact avif_apps_internal.
target_compile_definitions(avif_apps_obj PRIVATE $<BUILD_INTERFACE:$<TARGET_PROPERTY:avif,INTERFACE_COMPILE_DEFINITIONS>>)
target_link_libraries(avif_apps_obj PUBLIC avif_obj PNG::PNG ZLIB::ZLIB JPEG::JPEG)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
Expand Down
7 changes: 6 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ macro(add_avif_gtest_with_data TEST_NAME)
target_link_libraries(${TEST_NAME} PRIVATE aviftest_helpers GTest::gtest ${ARGN})
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/data/)
endmacro()
macro(add_avif_internal_gtest_with_data TEST_NAME)
add_executable(${TEST_NAME} gtest/${TEST_NAME}.cc)
target_link_libraries(${TEST_NAME} PRIVATE aviftest_helpers_internal GTest::gtest ${ARGN})
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/data/)
endmacro()

if(AVIF_ENABLE_GTEST OR AVIF_ENABLE_FUZZTEST)
if(NOT TARGET GTest::gtest)
Expand Down Expand Up @@ -125,7 +130,7 @@ if(AVIF_ENABLE_GTEST)
add_test(NAME avifincrtest COMMAND avifincrtest ${CMAKE_CURRENT_SOURCE_DIR}/data/)

add_avif_internal_gtest(avifcolrtest)
add_avif_gtest_with_data(avifcolrconverttest)
add_avif_internal_gtest_with_data(avifcolrconverttest)
add_avif_gtest_with_data(avifiostatstest)
add_avif_gtest_with_data(aviflosslesstest)
add_avif_gtest_with_data(avifmetadatatest)
Expand Down
9 changes: 0 additions & 9 deletions tests/gtest/avifincrtest_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ static inline void avifBreakOnError() {
} \
} while (0)

// Forward any error to the caller now or continue execution.
#define AVIF_CHECKRES(A) \
do { \
const avifResult result__ = (A); \
if (result__ != AVIF_RESULT_OK) { \
avifBreakOnError(); \
return result__; \
} \
} while (0)
//------------------------------------------------------------------------------

// Encodes a portion of the image to be decoded incrementally.
Expand Down
2 changes: 1 addition & 1 deletion tests/gtest/aviftest_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace avif {
namespace testutil {

//------------------------------------------------------------------------------
// Duplicated from internal.h
// CopyImageSamples is a copy of avifImageCopySamples

namespace {
void CopyImageSamples(avifImage* dstImage, const avifImage* srcImage,
Expand Down
6 changes: 3 additions & 3 deletions tests/gtest/aviftest_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#include "avif/avif.h"
#include "avif/avif_cxx.h"

namespace avif {
namespace testutil {

//------------------------------------------------------------------------------
// Duplicated from internal.h
// Used for debugging. Define AVIF_BREAK_ON_ERROR to catch the earliest failure
Expand Down Expand Up @@ -61,6 +58,9 @@ static inline void avifBreakOnError() {
} while (0)
//------------------------------------------------------------------------------

namespace avif {
namespace testutil {

//------------------------------------------------------------------------------

// ICC color profiles are not checked by libavif so the content does not matter.
Expand Down

0 comments on commit 152292e

Please sign in to comment.