#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/message_fragment.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validation_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/union_unittest.test-mojom.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_unions.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace test {
namespace union_unittest {
template <typename InputType, typename DataType>
size_t SerializeStruct(InputType& input,
mojo::Message* message,
DataType** out_data) { … }
template <typename InputType, typename DataType>
size_t SerializeUnion(InputType& input,
mojo::Message* message,
DataType** out_data = nullptr) { … }
template <typename DataViewType, bool nullable_elements, typename InputType>
size_t SerializeArray(InputType& input,
mojo::Message* message,
typename DataViewType::Data_** out_data) { … }
TEST(UnionTest, PlainOldDataGetterSetter) { … }
TEST(UnionTest, PlainOldDataFactoryFunction) { … }
TEST(UnionTest, PodEquals) { … }
TEST(UnionTest, PodClone) { … }
TEST(UnionTest, PodSerialization) { … }
TEST(UnionTest, EnumSerialization) { … }
TEST(UnionTest, PodValidation) { … }
TEST(UnionTest, SerializeNotNull) { … }
TEST(UnionTest, SerializeIsNullInlined) { … }
TEST(UnionTest, SerializeIsNullNotInlined) { … }
TEST(UnionTest, NullValidation) { … }
TEST(UnionTest, OOBValidation) { … }
TEST(UnionTest, UnknownTagValidation) { … }
TEST(UnionTest, UnknownEnumValueValidation) { … }
TEST(UnionTest, UnknownExtensibleEnumValueValidation) { … }
TEST(UnionTest, StringGetterSetter) { … }
TEST(UnionTest, StringFactoryFunction) { … }
TEST(UnionTest, StringEquals) { … }
TEST(UnionTest, StringClone) { … }
TEST(UnionTest, StringSerialization) { … }
TEST(UnionTest, NullStringValidation) { … }
TEST(UnionTest, StringPointerOverflowValidation) { … }
TEST(UnionTest, StringValidateOOB) { … }
TEST(UnionTest, PodUnionInArray) { … }
TEST(UnionTest, PodUnionInArraySerialization) { … }
TEST(UnionTest, PodUnionInArraySerializationWithNull) { … }
TEST(UnionTest, ObjectUnionInArraySerialization) { … }
TEST(UnionTest, Clone_Union) { … }
TEST(UnionTest, Serialization_UnionOfPods) { … }
TEST(UnionTest, Serialization_UnionOfObjects) { … }
TEST(UnionTest, Validation_UnionsInStruct) { … }
TEST(UnionTest, Validation_PodUnionInStruct_Failure) { … }
TEST(UnionTest, Validation_NullUnion_Failure) { … }
TEST(UnionTest, Validation_NullableUnion) { … }
TEST(UnionTest, PodUnionInMap) { … }
TEST(UnionTest, PodUnionInMapSerialization) { … }
TEST(UnionTest, PodUnionInMapSerializationWithNull) { … }
TEST(UnionTest, StructInUnionGetterSetterPasser) { … }
TEST(UnionTest, StructInUnionSerialization) { … }
TEST(UnionTest, StructInUnionValidation) { … }
TEST(UnionTest, StructInUnionValidationNonNullable) { … }
TEST(UnionTest, StructInUnionValidationNullable) { … }
TEST(UnionTest, ArrayInUnionGetterSetter) { … }
TEST(UnionTest, ArrayInUnionSerialization) { … }
TEST(UnionTest, ArrayInUnionValidation) { … }
TEST(UnionTest, MapInUnionGetterSetter) { … }
TEST(UnionTest, MapInUnionSerialization) { … }
TEST(UnionTest, MapInUnionValidation) { … }
TEST(UnionTest, UnionInUnionGetterSetter) { … }
TEST(UnionTest, UnionInUnionFactoryFunction) { … }
TEST(UnionTest, UnionInUnionSerialization) { … }
TEST(UnionTest, UnionInUnionValidation) { … }
TEST(UnionTest, UnionInUnionValidationNonNullable) { … }
TEST(UnionTest, HandleInUnionGetterSetter) { … }
TEST(UnionTest, HandleInUnionGetterFactoryFunction) { … }
TEST(UnionTest, HandleInUnionSerialization) { … }
TEST(UnionTest, HandleInUnionValidation) { … }
TEST(UnionTest, HandleInUnionValidationNull) { … }
class SmallCacheImpl : public SmallCache { … };
TEST(UnionTest, InterfaceInUnion) { … }
TEST(UnionTest, InterfaceInUnionFactoryFunction) { … }
TEST(UnionTest, InterfaceInUnionSerialization) { … }
class UnionInterfaceImpl : public UnionInterface { … };
TEST(UnionTest, UnionInInterface) { … }
TEST(UnionTest, InlineUnionAllocationWithNonPODFirstField) { … }
class ExtensibleTestUnionExchange
: public mojom::ExtensibleTestUnionExchangeV1 { … };
TEST(UnionTest, ExtensibleUnion) { … }
}
}
}