#include "client/length_delimited_ring_buffer.h"
#include <stdint.h>
#include <array>
#include <string>
#include <vector>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace crashpad {
namespace test {
namespace {
Eq;
IsFalse;
IsTrue;
constexpr char kValidBufferSize3[] = …;
constexpr size_t kValidBufferSize3Len = …;
constexpr char kInvalidVersionBuffer[] = …;
constexpr size_t kInvalidVersionBufferLen = …;
constexpr char kMidCrashBuffer[] = …;
constexpr size_t kMidCrashBufferLen = …;
constexpr uint8_t kHello[] = …;
constexpr char kInvalidBase128VarintBuffer[] = …;
constexpr size_t kInvalidBase128VarintBufferLen = …;
constexpr char kInvalidBase128VarintBits33And34SetBuffer[] = …;
constexpr size_t kInvalidBase128VarintBits33And34SetBufferLen = …;
constexpr char kInvalidPayloadBufferTooShort[] = …;
constexpr size_t kInvalidPayloadBufferTooShortLen = …;
TEST(LengthDelimitedRingBufferTest,
RingBufferDataShouldStartWithMagicAndVersion) { … }
TEST(LengthDelimitedRingBufferTest,
EmptyBufferSizeShouldIncludeHeaderInRingBufferLength) { … }
TEST(LengthDelimitedRingBufferTest,
NonEmptyBufferSizeShouldIncludeHeaderAndData) { … }
TEST(LengthDelimitedRingBufferTest, PopOnEmptyBufferShouldFail) { … }
TEST(LengthDelimitedRingBufferTest, PushZeroLengthShouldFail) { … }
TEST(LengthDelimitedRingBufferTest, PushExactlyBufferSizeThenPopShouldSucceed) { … }
TEST(LengthDelimitedRingBufferTest, PushLargerThanBufferSizeShouldFail) { … }
TEST(LengthDelimitedRingBufferTest,
PushUntilFullThenPopUntilEmptyShouldReturnInFIFOOrder) { … }
TEST(LengthDelimitedRingBufferTest,
PushThenPopBuffersOfDifferingLengthsShouldReturnBuffers) { … }
TEST(LengthDelimitedRingBufferDataTest, PushOnFullBufferShouldOverwriteOldest) { … }
TEST(LengthDelimitedRingBufferDataTest,
PushOnFullBufferShouldOverwriteMultipleOldest) { … }
TEST(LengthDelimitedRingBufferDataTest, PushThenPopWithLengthVarintTwoBytes) { … }
TEST(LengthDelimitedRingBufferDataTest, DeserializeFromTooShortShouldFail) { … }
TEST(LengthDelimitedRingBufferDataTest, DeserializeFromTooLongShouldFail) { … }
TEST(LengthDelimitedRingBufferDataTest,
DeserializeFromInvalidVersionShouldFail) { … }
TEST(LengthDelimitedRingBufferDataTest,
DeserializeFromInvalidVarintLengthShouldSucceedButPopShouldFail) { … }
TEST(LengthDelimitedRingBufferDataTest,
DeserializeFromInvalidVarintBitsShouldSucceedButPopShouldFail) { … }
TEST(LengthDelimitedRingBufferDataTest,
DeserializeFromInvalidPayloadBufferTooShortShouldSucceedButPopShouldFail) { … }
TEST(LengthDelimitedRingBufferDataTest,
DeserializeFromFullBufferShouldSucceed) { … }
TEST(LengthDelimitedRingBufferDataTest,
DeserializeFromMidCrashBufferShouldSucceedButSubsequentPopShouldFail) { … }
}
}
}