From 4cf16febf68a24128b4a9b75a83e4930f127151b Mon Sep 17 00:00:00 2001 From: Lam Wei Lun Date: Wed, 14 Oct 2026 18:23:32 +0800 Subject: [PATCH] Fix plugin unit test --- tests/slic3rutils/test_plugin_resource_texture.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/slic3rutils/test_plugin_resource_texture.cpp b/tests/slic3rutils/test_plugin_resource_texture.cpp index efe7cfbb86..c57a39b5e1 100644 --- a/tests/slic3rutils/test_plugin_resource_texture.cpp +++ b/tests/slic3rutils/test_plugin_resource_texture.cpp @@ -258,13 +258,17 @@ std::vector make_gray_bmp(int width, int height, uint8_t value) return bmp; } -// The app calls wxInitAllImageHandlers() during startup; the test binary has no app. +// The app calls wxInitAllImageHandlers() during startup and, before that, wxEntryStart() runs the +// wxImageModule, which registers the standard handlers. wxInitAllImageHandlers() adds PNG, JPEG and +// the rest but NOT the BMP handler, so a test binary without a wxApp must add the standard set too or +// a .bmp texture cannot be loaded here at all. void ensure_wx_image_handlers() { static bool initialized = false; if (initialized) return; initialized = true; + wxImage::InitStandardHandlers(); wxInitAllImageHandlers(); }