blob: 26ab5fa4348761a29c2dbf8cb04401d23a2840af [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/camera/bin/device/util.h"
#include <gtest/gtest.h>
#include "src/camera/lib/fake_controller/fake_controller.h"
namespace camera {
TEST(UtilTest, ConvertConfig) {
auto configs = FakeController::GetDefaultConfigs();
ASSERT_FALSE(configs.empty());
auto& a = configs[0];
ASSERT_FALSE(a.stream_configs.empty());
ASSERT_FALSE(a.stream_configs[0].image_formats.empty());
auto result = Convert(a);
ASSERT_TRUE(result.is_ok());
auto b = result.take_value();
EXPECT_EQ(a.stream_configs.size(), b.streams().size());
}
} // namespace camera