Tests: add tests for lcameraDev, fix qutex tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user