#include "llvm/ADT/SmallString.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
#include <optional>
usingnamespacellvm;
namespace {
template<typename T> std::string printToString(const T &Value) { … }
template<typename T> std::string printToString(const T &Value,
unsigned BytesLeftInBuffer) { … }
template<typename T> std::string printToStringUnbuffered(const T &Value) { … }
struct X { … };
raw_ostream &operator<<(raw_ostream &OS, const X &) { … }
TEST(raw_ostreamTest, Types_Buffered) { … }
TEST(raw_ostreamTest, Types_Unbuffered) { … }
TEST(raw_ostreamTest, BufferEdge) { … }
TEST(raw_ostreamTest, TinyBuffer) { … }
TEST(raw_ostreamTest, WriteEscaped) { … }
TEST(raw_ostreamTest, Justify) { … }
TEST(raw_ostreamTest, Indent) { … }
TEST(raw_ostreamTest, FormatHex) { … }
TEST(raw_ostreamTest, FormatDecimal) { … }
static std::string
formatted_bytes_str(ArrayRef<uint8_t> Bytes,
std::optional<uint64_t> Offset = std::nullopt,
uint32_t NumPerLine = 16, uint8_t ByteGroupSize = 4) { … }
static std::string format_bytes_with_ascii_str(
ArrayRef<uint8_t> Bytes, std::optional<uint64_t> Offset = std::nullopt,
uint32_t NumPerLine = 16, uint8_t ByteGroupSize = 4) { … }
TEST(raw_ostreamTest, FormattedHexBytes) { … }
#ifdef LLVM_ON_UNIX
TEST(raw_ostreamTest, Colors) { … }
#endif
TEST(raw_fd_ostreamTest, multiple_raw_fd_ostream_to_stdout) { … }
TEST(raw_ostreamTest, flush_tied_to_stream_on_write) { … }
static void checkFileData(StringRef FileName, StringRef GoldenData) { … }
TEST(raw_ostreamTest, raw_fd_ostream_mutual_ties) { … }
TEST(raw_ostreamTest, reserve_stream) { … }
TEST(raw_ostreamTest, writeToOutputFile) { … }
#ifndef _WIN32
TEST(raw_ostreamTest, filePermissions) { … }
#endif
TEST(raw_ostreamTest, writeToNonexistingPath) { … }
TEST(raw_ostreamTest, writeToDevNull) { … }
TEST(raw_ostreamTest, writeToStdOut) { … }
}