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