Files
salmanoff/commonLibs/lcameraDev/tests/cameraIdentity_tests.cpp
T

25 lines
638 B
C++
Raw Normal View History

#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