Tests: add tests for lcameraDev, fix qutex tests

This commit is contained in:
2026-06-13 16:08:21 -04:00
parent 46f767f232
commit 2458c83c6b
9 changed files with 398 additions and 73 deletions
+12 -7
View File
@@ -129,6 +129,18 @@ CameraIdentityRecord resolveSelectorAgainstRecords(
const CameraIdentityRecord& indexedRecord =
records.at(static_cast<size_t>(*indexCriterion));
bool hasNonIndexCriteria = false;
for (const SelectorCriterion& criterion : criteria)
{
if (criterion.kind != SelectorCriterionKind::Index)
{
hasNonIndexCriteria = true;
break;
}
}
if (!hasNonIndexCriteria) { return indexedRecord; }
auto it = std::find_if(
matches.begin(), matches.end(),
[&indexedRecord](const CameraIdentityRecord* candidate) {
@@ -141,13 +153,6 @@ CameraIdentityRecord resolveSelectorAgainstRecords(
"index: criterion conflicts with other selector clauses");
}
if (matches.size() > 1)
{
throw std::runtime_error(
"Ambiguous deviceSelector: multiple cameras match\n"
+ formatCameraListForDiagnostics(records));
}
return indexedRecord;
}