#include #include #include #include #include "render/opengl/openglrenderer.h" TEST(OpenGLRenderer, DownloadFromTextureWithoutCurrentContext) { if (std::getenv("CI")) { GTEST_SKIP() << "Skipping OpenGL test in CI environment"; } QOpenGLContext context; if (!context.create()) { GTEST_SKIP() << "Skipping OpenGL test because no context can be created"; } ASSERT_EQ(QOpenGLContext::currentContext(), nullptr); olive::OpenGLRenderer renderer; renderer.init(&context); olive::VideoParams params(4, 4, olive::core::PixelFormat::u8, 4, olive::core::Rational(1, 1), olive::VideoParams::k_interlace_none, 1); unsigned char buffer[4 * 4 * 4] = {}; renderer.download_from_texture(QVariant::fromValue(0), params, buffer, 4 * 4); EXPECT_EQ(QOpenGLContext::currentContext(), nullptr); }