#include "src/mutator.h"
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <memory>
#include <random>
#include <string>
#include <utility>
#include <vector>
#include "src/field_instance.h"
#include "src/utf8_fix.h"
#include "src/weighted_reservoir_sampler.h"
namespace protobuf_mutator {
Any;
Descriptor;
FieldDescriptor;
FileDescriptor;
Message;
OneofDescriptor;
Reflection;
MessageDifferencer;
_1;
namespace {
const int kMaxInitializeDepth = …;
const uint64_t kDefaultMutateWeight = …;
enum class Mutation : uint8_t { … };
MutationBitset;
Messages;
ConstMessages;
size_t GetRandomIndex(RandomEngine* random, size_t count) { … }
void FlipBit(size_t size, uint8_t* bytes, RandomEngine* random) { … }
template <class T>
T FlipBit(T value, RandomEngine* random) { … }
bool GetRandomBool(RandomEngine* random, size_t n = 2) { … }
bool IsProto3SimpleField(const FieldDescriptor& field) { … }
struct CreateDefaultField : public FieldFunction<CreateDefaultField> { … };
struct DeleteField : public FieldFunction<DeleteField> { … };
struct CopyField : public FieldFunction<CopyField> { … };
struct AppendField : public FieldFunction<AppendField> { … };
class CanCopyAndDifferentField
: public FieldFunction<CanCopyAndDifferentField, bool> { … };
class MutationSampler { … };
class DataSourceSampler { … };
UnpackedAny;
const Descriptor* GetAnyTypeDescriptor(const Any& any) { … }
std::unique_ptr<Message> UnpackAny(const Any& any) { … }
const Any* CastToAny(const Message* message) { … }
Any* CastToAny(Message* message) { … }
std::unique_ptr<Message> UnpackIfAny(const Message& message) { … }
void UnpackAny(const Message& message, UnpackedAny* result) { … }
class PostProcessing { … };
}
class FieldMutator { … };
namespace {
struct MutateField : public FieldFunction<MutateField> { … };
struct CreateField : public FieldFunction<CreateField> { … };
}
void Mutator::Seed(uint32_t value) { … }
void Mutator::Fix(Message* message) { … }
void Mutator::Mutate(Message* message, size_t max_size_hint) { … }
void Mutator::CrossOver(const Message& message1, Message* message2,
size_t max_size_hint) { … }
void Mutator::RegisterPostProcessor(const Descriptor* desc,
PostProcess callback) { … }
bool Mutator::MutateImpl(const ConstMessages& sources, const Messages& messages,
bool copy_clone_only, int size_increase_hint) { … }
int32_t Mutator::MutateInt32(int32_t value) { … }
int64_t Mutator::MutateInt64(int64_t value) { … }
uint32_t Mutator::MutateUInt32(uint32_t value) { … }
uint64_t Mutator::MutateUInt64(uint64_t value) { … }
float Mutator::MutateFloat(float value) { … }
double Mutator::MutateDouble(double value) { … }
bool Mutator::MutateBool(bool value) { … }
size_t Mutator::MutateEnum(size_t index, size_t item_count) { … }
std::string Mutator::MutateString(const std::string& value,
int size_increase_hint) { … }
std::string Mutator::MutateUtf8String(const std::string& value,
int size_increase_hint) { … }
bool Mutator::IsInitialized(const Message& message) const { … }
}