AsyncLoop: Add test for zero-iteration loops

This mnemonically ensures that we'll remember to check for
these kinds of async loops.
This commit is contained in:
2025-09-11 20:08:35 -04:00
parent fb17c51ef6
commit 89947dfc71
2 changed files with 17 additions and 0 deletions
+12
View File
@@ -363,6 +363,12 @@ void SenseApiManager::attachAllSenseDevicesFromSpecsReq(
auto request = std::make_shared<AttachAllSenseDevicesFromSpecsReq>(
device::DeviceManager::deviceAttachmentSpecs.size(), std::move(cb));
if (request->loop.nTotalIsZero())
{
cb(request->loop);
return;
}
for (const auto& spec : device::DeviceManager::deviceAttachmentSpecs)
{
try {
@@ -421,6 +427,12 @@ void SenseApiManager::detachAllSenseDevicesReq(
auto request = std::make_shared<DetachAllSenseDevicesReq>(
device::DeviceManager::deviceAttachmentSpecs.size(), std::move(cb));
if (request->loop.nTotalIsZero())
{
cb(request->loop);
return;
}
for (const auto& spec : device::DeviceManager::deviceAttachmentSpecs)
{
try {