#include "quiche/common/wire_serialization.h"
#include <array>
#include <limits>
#include <optional>
#include <string>
#include <vector>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/common/platform/api/quiche_expect_bug.h"
#include "quiche/common/platform/api/quiche_test.h"
#include "quiche/common/quiche_buffer_allocator.h"
#include "quiche/common/quiche_endian.h"
#include "quiche/common/quiche_status_utils.h"
#include "quiche/common/simple_buffer_allocator.h"
#include "quiche/common/test_tools/quiche_test_utils.h"
namespace quiche::test {
namespace {
ElementsAre;
constexpr uint64_t kInvalidVarInt = …;
template <typename... Ts>
absl::StatusOr<quiche::QuicheBuffer> SerializeIntoSimpleBuffer(Ts... data) { … }
template <typename... Ts>
void ExpectEncoding(const std::string& description, absl::string_view expected,
Ts... data) { … }
template <typename... Ts>
void ExpectEncodingHex(const std::string& description,
absl::string_view expected_hex, Ts... data) { … }
TEST(SerializationTest, SerializeStrings) { … }
TEST(SerializationTest, SerializeIntegers) { … }
TEST(SerializationTest, SerializeLittleEndian) { … }
TEST(SerializationTest, SerializeVarInt62) { … }
TEST(SerializationTest, SerializeStringWithVarInt62Length) { … }
TEST(SerializationTest, SerializeOptionalValues) { … }
enum class TestEnum { … };
TEST(SerializationTest, SerializeEnumValue) { … }
TEST(SerializationTest, SerializeLotsOfValues) { … }
TEST(SerializationTest, FailDueToLackOfSpace) { … }
TEST(SerializationTest, FailDueToInvalidValue) { … }
TEST(SerializationTest, InvalidValueCausesPartialWrite) { … }
TEST(SerializationTest, SerializeVector) { … }
struct AwesomeStruct { … };
class WireAwesomeStruct { … };
TEST(SerializationTest, CustomStruct) { … }
TEST(SerializationTest, CustomStructSpan) { … }
class WireFormatterThatWritesTooLittle { … };
TEST(SerializationTest, CustomStructWritesTooLittle) { … }
TEST(SerializationTest, Empty) { … }
}
}