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
@@ -0,0 +1,24 @@
#include <gtest/gtest.h>
#include <cameraIdentity.h>
#include <libcamera/property_ids.h>
namespace lcamera_dev {
namespace {
TEST(LocationPropertyToLabelTest, MapsKnownLocations)
{
using namespace libcamera::properties;
EXPECT_EQ(locationPropertyToLabel(CameraLocationFront), "front");
EXPECT_EQ(locationPropertyToLabel(CameraLocationBack), "back");
EXPECT_EQ(locationPropertyToLabel(CameraLocationExternal), "external");
}
TEST(LocationPropertyToLabelTest, UnknownLocationReturnsEmptyString)
{
EXPECT_EQ(locationPropertyToLabel(-1), "");
EXPECT_EQ(locationPropertyToLabel(99), "");
}
} // namespace
} // namespace lcamera_dev