diff options
Diffstat (limited to 'test/test_apng.cpp')
| -rw-r--r-- | test/test_apng.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/test/test_apng.cpp b/test/test_apng.cpp deleted file mode 100644 index c092191f..00000000 --- a/test/test_apng.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include <catch2/catch.hpp> - -#include <QCoreApplication> -#include <QGuiApplication> -#include <QImageReader> -#include <QPixmap> -#include <QPluginLoader> - -TEST_CASE("Support APNG Plugin", "[apng]") -{ - // Check paths for libs - QCoreApplication::addLibraryPath("."); - QCoreApplication::addLibraryPath("lib"); - - // Either it's loaded from system or we load local - QPluginLoader apngPlugin("qapng"); - apngPlugin.load(); - - INFO(QImageReader::supportedImageFormats().join(' ').toStdString()); - REQUIRE(QImageReader::supportedImageFormats().contains("apng")); -} - -TEST_CASE("Detect png animation", "[apng]") -{ - // Required for QPixmap methods - int argc = 1; - char bin[] = "test"; - char *argv[] = {bin}; - QGuiApplication app(argc, argv); - - // Instantiate reader - QImageReader reader; - - SECTION("Decide format from content fails on apng") - { - reader.setFileName("snackoo.png"); - reader.setDecideFormatFromContent(true); - REQUIRE(!reader.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); - } - - SECTION("Auto detect fails on apng") - { - reader.setFileName("snackoo.png"); - reader.setAutoDetectImageFormat(true); - REQUIRE(!reader.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); - } - - SECTION("Detect apng supports animation") - { - reader.setFileName("snackoo.png"); - reader.setFormat("apng"); - REQUIRE(reader.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); - } - - SECTION("Detect png frame has no animation") - { - reader.setFileName("missle.png"); - reader.setFormat("apng"); - REQUIRE(!reader.supportsAnimation()); - reader.setFormat("png"); - REQUIRE(!reader.supportsAnimation()); - REQUIRE(!QPixmap::fromImage(reader.read()).isNull()); - } -} |
