Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
Matevz Morato committed Feb 4, 2025
1 parent 45e6d68 commit b675be4
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 57 deletions.
7 changes: 3 additions & 4 deletions include/depthai/utility/ImageManipV2Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2191,9 +2191,8 @@ inline bool isSingleChannelu8(const dai::ImgFrame::Type type) {
return type == dai::ImgFrame::Type::GRAY8 || type == dai::ImgFrame::Type::RAW8;
}
inline bool isSingleChannel(const dai::ImgFrame::Type type) {
return type == dai::ImgFrame::Type::GRAY8 || type == dai::ImgFrame::Type::RAW8 ||
type == dai::ImgFrame::Type::RAW16 || type == dai::ImgFrame::Type::GRAYF16 ||
type == dai::ImgFrame::Type::RAW32;
return type == dai::ImgFrame::Type::GRAY8 || type == dai::ImgFrame::Type::RAW8 || type == dai::ImgFrame::Type::RAW16 || type == dai::ImgFrame::Type::GRAYF16
|| type == dai::ImgFrame::Type::RAW32;
}

template <typename T>
Expand Down Expand Up @@ -2404,7 +2403,7 @@ ImageManipOperations<ImageManipBuffer, ImageManipData>& ImageManipOperations<Ima
auto ccDstSpecs = getCcDstFrameSpecs(srcSpecs, inType, outputFrameType);
preprocCc.build(srcSpecs, ccDstSpecs, inType, outputFrameType);
} else {
if(!isTypeSupported(inType)) {
if(!isTypeSupported(inType)) {
auto color = getValidType(inType);
auto ccDstSpecs = getCcDstFrameSpecs(srcSpecs, inType, color);
preprocCc.build(srcSpecs, ccDstSpecs, inType, color);
Expand Down
107 changes: 54 additions & 53 deletions tests/src/ondevice_tests/filesystem_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,69 +251,70 @@ TEST_CASE("dai::Path with DeviceBootloader") {
dai::DeviceInfo deviceInfo;
std::tie(found, deviceInfo) = dai::DeviceBootloader::getFirstAvailableDevice();
if(found) {
if(deviceInfo.state == X_LINK_BOOTLOADER) {
std::cout << "Device is already booted into bootloader mode. Booting tests will be skipped." << std::endl;
if(deviceInfo.state == X_LINK_BOOTLOADER) {
std::cout << "Device is already booted into bootloader mode. Booting tests will be skipped." << std::endl;
} else {
REQUIRE_NOTHROW([&]() {
dai::DeviceBootloader bl(deviceInfo);
auto currentBlType = bl.getType();
}());
REQUIRE_NOTHROW([&]() {
dai::DeviceBootloader bl(deviceInfo, false);
auto currentBlType = bl.getType();
}());
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, &badfile[0]);
REQUIRE_NOTHROW([&]() {
dai::DeviceBootloader bl(deviceInfo);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, strBadfile);
}());
REQUIRE_NOTHROW([&]() {
dai::DeviceBootloader bl(deviceInfo, false);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, diaBadfile);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
}());
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, &badfile[0]);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, strBadfile);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, diaBadfile);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
#if defined(_WIN32) && defined(_MSC_VER)
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, &wideBadfile[0]);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, wstrBadfile);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, diaBadWide);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, &wideBadfile[0]);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, wstrBadfile);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, diaBadWide);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
#endif
#if defined(__cpp_lib_filesystem)
#if defined(__cpp_lib_char8_t)
const auto stdBadpath = std::filesystem::path(PATH4);
const auto stdBadpath = std::filesystem::path(PATH4);
#else
const auto stdBadpath = std::filesystem::u8path(PATH4);
const auto stdBadpath = std::filesystem::u8path(PATH4);
#endif
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, stdBadpath);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
REQUIRE_THROWS_WITH(
[&]() {
dai::DeviceBootloader bl(deviceInfo, stdBadpath);
auto currentBlType = bl.getType();
}(),
ContainsSubstring("doesn't exist"));
#endif
}} else {
}
} else {
std::cout << "No devices found" << std::endl;
}
}
Expand Down

0 comments on commit b675be4

Please sign in to comment.