blob: b82ab6a231f0f1418201bf83004af63e76247aeb [file] [log] [blame]
#include "firmware_handler.hpp"
#include "image_mock.hpp"
#include <memory>
#include <vector>
#include <gtest/gtest.h>
namespace blobs
{
TEST(FirmwareHandlerCanHandleTest, VerifyItemsInListAreOk)
{
struct ListItem
{
std::string name;
bool expected;
};
std::vector<ListItem> items = {
{"asdf", true}, {"nope", false}, {"123123", false}, {"bcdf", true}};
ImageHandlerMock imageMock;
std::vector<HandlerPack> blobs = {
{"asdf", &imageMock},
{"bcdf", &imageMock},
};
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
blobs, static_cast<uint16_t>(FirmwareUpdateFlags::bt));
for (const auto& item : items)
{
EXPECT_EQ(item.expected, handler->canHandleBlob(item.name));
}
}
} // namespace blobs