From 337b056400955c9384accf4bb4f3a58a768852cf Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 23:57:43 -0600 Subject: [PATCH] Add test for apng --- test/CMakeLists.txt | 6 +++--- test/test_apng.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test/test_apng.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3dd51c7..31aab1e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ -find_package(Qt5 COMPONENTS Core REQUIRED) +find_package(Qt5 COMPONENTS Core Gui REQUIRED) find_package(Catch2 REQUIRED) -add_executable(test test_aopacket.cpp test_caseloading.cpp ../include/aopacket.h ../src/aopacket.cpp) +add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) -target_link_libraries(test PRIVATE Qt5::Core Catch2::Catch2) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2) diff --git a/test/test_apng.cpp b/test/test_apng.cpp new file mode 100644 index 0000000..c1c0481 --- /dev/null +++ b/test/test_apng.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include +#include + +TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") { + QCoreApplication::addLibraryPath("."); + QPluginLoader apngPlugin("qapng"); + REQUIRE(apngPlugin.load()); + + // Fails for some reason on windows and linux don't know about osx + // apng animation seems to be broken linux qt5-5.15.2 + REQUIRE(QImageReader::supportedImageFormats().contains("APNG")); +}