From 7b17b29a61cc5914a2aadb06da57d45b3d842d78 Mon Sep 17 00:00:00 2001 From: Dale Phurrough Date: Wed, 7 Jun 2023 18:13:15 +0200 Subject: [PATCH] add comments; clarify debug log; tag test case - multiple devices test case is tagged so that it will not run with the default test list using the [.] syntax --- src/xlink/XLinkConnection.cpp | 7 ++++--- tests/src/multiple_devices_test.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xlink/XLinkConnection.cpp b/src/xlink/XLinkConnection.cpp index cb6de2a81..c7c6a765d 100644 --- a/src/xlink/XLinkConnection.cpp +++ b/src/xlink/XLinkConnection.cpp @@ -304,7 +304,7 @@ void XLinkConnection::close() { if(closed.exchange(true)) return; constexpr auto RESET_TIMEOUT = 2s; - constexpr auto BOOTUP_SEARCH = 5s; + constexpr auto BOOTUP_SEARCH = 5s; // majority of usb reboots on Windows need more than 5 seconds; this leads to a cascade failure if(deviceLinkId != -1 && rebootOnDestruction) { auto previousLinkId = deviceLinkId; @@ -428,7 +428,8 @@ void XLinkConnection::initDevice(const DeviceInfo& deviceToInit, XLinkDeviceStat const bool bootStatus = bootWithPath ? bootAvailableDevice(foundDeviceDesc, pathToMvcmd) : bootAvailableDevice(foundDeviceDesc, mvcmd); if(!bootStatus) { - throw std::runtime_error("Failed to boot device!"); + // this throw will cause an app to crash if not caught by a try/catch around the app's `Device` constructor + throw std::runtime_error("Failed to begin the boot of a device!"); } } @@ -444,7 +445,7 @@ void XLinkConnection::initDevice(const DeviceInfo& deviceToInit, XLinkDeviceStat // Use "name" as hint only, but might still change bootedDescInfo.nameHintOnly = true; - logger::debug("Searching for booted device: {}, name used as hint only", bootedDeviceInfo.toString()); + logger::debug("Searching for booted device: {}, name/path used as hint only", bootedDeviceInfo.toString()); // Find booted device deviceDesc_t foundDeviceDesc = {}; diff --git a/tests/src/multiple_devices_test.cpp b/tests/src/multiple_devices_test.cpp index 0b35009b0..eb258905d 100644 --- a/tests/src/multiple_devices_test.cpp +++ b/tests/src/multiple_devices_test.cpp @@ -103,7 +103,7 @@ TEST_CASE("Multiple devices with 50 messages each") { REQUIRE(finished); } -TEST_CASE("Multiple devices created and destroyed in parallel") { +TEST_CASE("Multiple devices created and destroyed in parallel", "[.][multi_test_devices]") { constexpr auto TEST_TIMEOUT = 30s; constexpr auto COLOR_FPS = 30; constexpr auto MONO_FPS = 30;