#include "bt.hpp"
#include "internal_sys_mock.hpp"

#include <cstring>
#include <ipmiblob/test/blob_interface_mock.hpp>

#include <gtest/gtest.h>

namespace host_tool
{

using ::testing::_;
using ::testing::ContainerEq;
using ::testing::Eq;
using ::testing::Invoke;
using ::testing::NotNull;
using ::testing::Return;

TEST(BtHandlerTest, verifySendsFileContents)
{
    /* In this very basic test, we'll feed the bt handler data from the internal
     * syscall mock and catch the writes via the blob mock.
     */
    internal::InternalSysMock sysMock;
    ipmiblob::BlobInterfaceMock blobMock;

    BtDataHandler handler(&blobMock, &sysMock);
    std::string filePath = "/asdf";
    int fd = 1;
    std::uint16_t session = 0xbeef;
    std::vector<std::uint8_t> bytes = {'1', '2', '3', '4'};

    EXPECT_CALL(sysMock, open(Eq(filePath), _)).WillOnce(Return(fd));
    EXPECT_CALL(sysMock, read(fd, NotNull(), _))
        .WillOnce(Invoke([&](int fd, void* buf, std::size_t count) {
            EXPECT_TRUE(count > bytes.size());
            std::memcpy(buf, bytes.data(), bytes.size());
            return bytes.size();
        }))
        .WillOnce(Return(0));
    EXPECT_CALL(sysMock, close(fd)).WillOnce(Return(0));

    EXPECT_CALL(blobMock, writeBytes(session, 0, ContainerEq(bytes)));

    EXPECT_TRUE(handler.sendContents(filePath, session));
}

} // namespace host_tool
