Go to the documentation of this file.
19 #include <gmock/gmock.h>
20 #include <gtest/gtest.h>
100 return "hi " + memento;
103 auto view =
slice.as_string_view();
137 TEST(ParsedMetadataTest, IsNotBinary) {
142 TEST(ParsedMetadataTest, IsBinary) {
147 TEST(ParsedMetadataTest, Set) {
156 EXPECT_CALL(c, SetInt64(-83481847284179298)).Times(1);
166 template <
typename T>
173 TypeParam::test_memento_transport_size());
178 TypeParam::test_memento_transport_size());
185 TypeParam::test_memento_transport_size());
188 TypeParam::DisplayValue(TypeParam::test_memento())));
193 TypeParam::test_memento_transport_size());
194 EXPECT_EQ(p.transport_size(), TypeParam::test_memento_transport_size());
206 using PMPtr = std::unique_ptr<PM>;
209 EXPECT_EQ(p->DebugString(),
"key: value");
214 <<
"Should not be called: msg=" <<
msg
215 <<
", value=" <<
value.as_string_view();
217 EXPECT_EQ(p->DebugString(),
"key: value");
218 EXPECT_EQ(p2.DebugString(),
"key: some_other_value");
221 EXPECT_EQ(p2.DebugString(),
"key: some_other_value");
224 EXPECT_EQ(p3.DebugString(),
"key: some_other_value");
230 using PMPtr = std::unique_ptr<PM>;
235 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: value");
240 <<
"Should not be called: msg=" <<
msg
241 <<
", value=" <<
value.as_string_view();
245 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: value");
247 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: "
252 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: "
257 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: "
265 int main(
int argc,
char** argv) {
#define EXPECT_FALSE(condition)
void Set(IntptrTrait, intptr_t x)
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
static intptr_t test_value()
static std::string DisplayValue(char value)
TYPED_TEST_P(TraitSpecializedTest, Noop)
static int64_t MementoToValue(int64_t memento)
static absl::string_view key()
static absl::string_view key()
std::string DebugString(const google::protobuf::Message &message)
static std::string DisplayValue(int32_t value)
static std::string DisplayValue(int64_t value)
static size_t test_memento_transport_size()
INSTANTIATE_TYPED_TEST_SUITE_P(My, TraitSpecializedTest, InterestingTraits)
::testing::Types< CharTrait, Int32Trait, Int64Trait, IntptrTrait, StringTrait > InterestingTraits
static absl::string_view key()
static char test_memento()
void Set(Int32Trait, int32_t x)
static size_t test_memento_transport_size()
static absl::string_view key()
TYPED_TEST_SUITE_P(TraitSpecializedTest)
void Set(const ParsedMetadata< FakeContainer > &metadata)
static intptr_t MementoToValue(intptr_t memento)
void Set(StringTrait, std::string x)
static int64_t test_value()
static size_t test_memento_transport_size()
static std::string MementoToValue(std::string memento)
REGISTER_TYPED_TEST_SUITE_P(TraitSpecializedTest, Noop, CanMove, DebugString, TransportSize)
ABSL_NAMESPACE_BEGIN ABSL_MUST_USE_RESULT bool SimpleAtoi(absl::string_view str, int_type *out)
void Set(CharTrait, char x)
static Slice FromCopiedString(const char *s)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
static int32_t test_memento()
static intptr_t test_memento()
static std::string DisplayValue(const std::string &value)
static int32_t test_value()
static std::string DisplayValue(intptr_t value)
static char MementoToValue(char memento)
MOCK_METHOD1(SetChar, void(char))
static size_t test_memento_transport_size()
static int64_t test_memento()
static std::string ParseMemento(Slice slice, MetadataParseErrorFn)
static int32_t MementoToValue(int32_t memento)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
static int32_t ParseMemento(Slice slice, MetadataParseErrorFn)
::grpc_core::ParsedMetadata< FakeContainer > FakeParsedMetadata
static std::string test_memento()
static absl::string_view key()
#define EXPECT_CALL(obj, call)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
static size_t test_memento_transport_size()
#define ASSERT_TRUE(condition)
static int64_t ParseMemento(Slice slice, MetadataParseErrorFn)
TEST(ServiceConfigParserTest, DoubleRegistration)
#define EXPECT_TRUE(condition)
static intptr_t ParseMemento(Slice slice, MetadataParseErrorFn)
void Set(Int64Trait, int64_t x)
static char ParseMemento(Slice slice, MetadataParseErrorFn)
static bool to_string(zval *from)
static std::string test_value()
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:39