#include "tile/net/internal/http_task.h"

#include "tile/base/make_unique.h"

#include "gtest/gtest.h"

#include <memory>
#include <utility>

namespace tile {
namespace internal {

TEST(HttpTask, All)
{
    HttpTask task;
    task.AddHeader("a:b");
    auto task2 = std::move(task);

    // Nothing to check. This UT indirectly tests there's no leak (via
    // heap-checker), no crash would occur.
}

TEST(HttpTaskCompletion, All)
{
    auto ptr  = object_pool::Get<HttpTaskCallContext>();
    ptr->body = make_unique<tile::NoncontiguousBufferBuilder>();
    HttpTaskCompletion comp(ptr.Leak());
    auto comp2 = std::move(comp);
    // No leak, no crash.
}

}// namespace internal
}// namespace tile
