From be9ae6ffbff4e2acbe10ea6701e9944b7bac49d8 Mon Sep 17 00:00:00 2001 From: peachismomo Date: Wed, 23 Sep 2026 00:35:33 +0800 Subject: [PATCH] fix(tests): make omitted printer agent operations answer like a missing agent --- .../printerAgent/PrinterAgentPluginCapabilityTrampoline.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/plugin/pluginTypes/printerAgent/PrinterAgentPluginCapabilityTrampoline.hpp b/src/slic3r/plugin/pluginTypes/printerAgent/PrinterAgentPluginCapabilityTrampoline.hpp index 74d5f82ab8..ce6445d738 100644 --- a/src/slic3r/plugin/pluginTypes/printerAgent/PrinterAgentPluginCapabilityTrampoline.hpp +++ b/src/slic3r/plugin/pluginTypes/printerAgent/PrinterAgentPluginCapabilityTrampoline.hpp @@ -264,8 +264,8 @@ public: // request_bind_ticket returns its ticket through a std::string* out-param, which pybind11 // cannot marshal back through a plain override. We dispatch manually: the Python plugin // returns a (result, ticket) tuple, which we unpack into the int result and the out-param. - // Not required to be implemented, so a missing override falls back to the base default - // instead of failing, mirroring what PYBIND11_OVERRIDE does for the other optional methods. + // Not required to be implemented, so a missing override answers with the same failure value + // as the other printer-agent operations. Leave the out-param untouched on failure. int request_bind_ticket(std::string* ticket) override { try { @@ -277,7 +277,7 @@ public: pybind11::function override = pybind11::get_override(static_cast(this), "request_bind_ticket"); if (!override) - return PrinterAgentPluginCapability::request_bind_ticket(ticket); + return printer_agent_failure(); try { pybind11::tuple result = override().cast(); if (ticket)