diff --git a/test/test_nrf52_usb_lifecycle.py b/test/test_nrf52_usb_lifecycle.py index 33a9914b7..8489f2d9d 100644 --- a/test/test_nrf52_usb_lifecycle.py +++ b/test/test_nrf52_usb_lifecycle.py @@ -100,6 +100,7 @@ static std::atomic usb_logging_preference_known{false}; static bool enabled = false, dedicated_usb_logging_port_started = false; static bool dedicated_usb_logging_port_configured = false; static bool isUsbLoggingEnabled() { return enabled; } +static bool isUsbLoggingPacketStream() { return false; } static bool isUsbDebugLoggingEnabled() { return false; } static void setPlatformDebugOutputEnabled(bool) {} struct Port { @@ -257,6 +258,8 @@ struct Device { } TinyUSBDevice; namespace mesh { static void clearUsbLoggingClientActivity() {} +static bool isUsbLoggingPacketStream() { return false; } +@DEDICATED@ @GATES@ static std::atomic dedicated_usb_logging_port_connected{true}; static std::atomic dedicated_usb_logging_reset_generation{0}; @@ -302,6 +305,7 @@ int main() { } ''' source = source.replace("@GATES@", gates) + source = source.replace("@DEDICATED@", function("bool hasDedicatedUsbLoggingPort(")) source = source.replace("@RESTART@", function("static void restartDedicatedUsbLoggingHostSession()")) source = source.replace("@COMPLETE@", function("static void completePrimaryUsbSessionReset(")) self.run_native(source) diff --git a/test/test_nrf52_usb_logging_contract.py b/test/test_nrf52_usb_logging_contract.py index ad1896608..45aade847 100644 --- a/test/test_nrf52_usb_logging_contract.py +++ b/test/test_nrf52_usb_logging_contract.py @@ -664,8 +664,9 @@ class Nrf52UsbLoggingContractTest(unittest.TestCase): self.assertEqual(source.count("finishPendingRequest(result, tag, est_timeout);"), 6) delayed = (ROOT / "src/helpers/CompanionDelayedReplies.cpp").read_text() arm = extract_braced(delayed, "void CompanionDelayedReplies::arm(") - self.assertIn("timeout + timeout / 5", arm) - self.assertIn("reply.radio_deadline = now + budget;", arm) + # Exact timeout windows and delayed SENT admission are exercised by + # test_companion_delayed_reply_delivery.py against real callbacks. + self.assertIn("radioBudget(reply)", arm) self.assertIn("reply.sent_deadline = now + DELIVERY_GRACE_MS;", arm) self.assertIn("servicePendingSerialReply();", source) self.assertIn(