Go to the documentation of this file.
30 #include "absl/strings/str_format.h"
31 #include "absl/strings/str_join.h"
33 #include <grpc/byte_buffer.h>
45 #define ROOT_EXPECTATION 1000
58 bool check_success_arg,
int success_arg,
bool* seen_arg)
136 for (
i = 0;
i < nslices;
i++) {
143 for (
i = 0;
i < nslices;
i++) {
169 if (bb ==
nullptr)
return 0;
175 &decompressed_buffer));
177 decompressed_buffer.
slices, decompressed_buffer.
count);
191 return reinterpret_cast<uintptr_t>(
p) < 1000000;
207 e.success,
e.file,
e.line);
218 std::vector<std::string> expectations;
219 for (
const auto& e :
v.expectations) {
220 expectations.push_back(ExpectationString(e));
229 ExpectationsString(*v).c_str());
237 if (e.check_success && e.success != ev.
success) {
239 ExpectationString(e).
c_str());
255 for (
auto e = expectations->begin(); e != expectations->end(); ++e) {
256 if (e->tag == ev.
tag) {
258 if (e->seen !=
nullptr) {
261 expectations->erase(e);
270 while (!
v->expectations.empty()) {
283 v->maybe_expectations.clear();
292 GPR_ASSERT(
v->expectations.empty() &&
"expectation queue must be empty");
305 void*
tag,
bool success,
bool*
seen) {
307 true , success,
seen);
std::string & StrAppendFormat(std::string *dst, const FormatSpec< Args... > &format, const Args &... args)
GPRAPI void grpc_slice_unref(grpc_slice s)
GPRAPI void grpc_slice_buffer_destroy(grpc_slice_buffer *sb)
grpc_completion_type type
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
GRPCAPI grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slices, size_t nslices)
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec< Args... > &format, const Args &... args)
GPRAPI grpc_slice grpc_slice_from_copied_string(const char *source)
int raw_byte_buffer_eq_slice(grpc_byte_buffer *rbb, grpc_slice b)
Expectation(const char *f, int l, grpc_completion_type t, void *tag_arg, bool check_success_arg, int success_arg, bool *seen_arg)
struct grpc_byte_buffer::grpc_byte_buffer_data::grpc_compressed_buffer raw
void cq_expect_completion_any_status(cq_verifier *v, const char *file, int line, void *tag)
static void add(cq_verifier *v, const char *file, int line, grpc_completion_type type, void *tag, bool check_success, bool success)
int byte_buffer_eq_string(grpc_byte_buffer *bb, const char *str)
static int has_metadata_slices(const grpc_metadata *md, size_t count, grpc_slice key, grpc_slice value)
GPRAPI grpc_slice grpc_slice_malloc(size_t length)
static void verify_matches(const Expectation &e, const grpc_event &ev)
void cq_maybe_expect_completion(cq_verifier *v, const char *file, int line, void *tag, bool success, bool *seen)
int contains_metadata_slices(grpc_metadata_array *array, grpc_slice key, grpc_slice value)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void cq_expect_completion(cq_verifier *v, const char *file, int line, void *tag, bool success)
void cq_verify_empty(cq_verifier *v)
std::string StrJoin(Iterator start, Iterator end, absl::string_view sep, Formatter &&fmt)
def c_str(s, encoding='ascii')
static void * tag(intptr_t t)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
void cq_verifier_destroy(cq_verifier *v)
#define GRPC_SLICE_START_PTR(slice)
cq_verifier * cq_verifier_create(grpc_completion_queue *cq)
grpc_completion_queue * cq
_W64 unsigned int uintptr_t
int grpc_msg_decompress(grpc_compression_algorithm algorithm, grpc_slice_buffer *input, grpc_slice_buffer *output)
int contains_metadata(grpc_metadata_array *array, const char *key, const char *value)
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb)
#define GRPC_SLICE_LENGTH(slice)
union grpc_byte_buffer::grpc_byte_buffer_data data
std::list< Expectation > expectations
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
static int has_metadata(const grpc_metadata *md, size_t count, const char *key, const char *value)
grpc_compression_algorithm compression
GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)
GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
void cq_verify(cq_verifier *v, int timeout_sec)
std::list< Expectation > maybe_expectations
struct cq_verifier cq_verifier
bool FindExpectations(std::list< Expectation > *expectations, const grpc_event &ev)
static void fail_no_event_received(cq_verifier *v)
grpc_slice_buffer slice_buffer
std::string grpc_event_string(grpc_event *ev)
static bool is_probably_integer(void *p)
grpc_completion_type type
void cq_verify_empty_timeout(cq_verifier *v, int timeout_sec)
static grpc_slice merge_slices(grpc_slice *slices, size_t nslices)
GPRAPI int grpc_slice_str_cmp(grpc_slice a, const char *b)
int byte_buffer_eq_slice(grpc_byte_buffer *bb, grpc_slice b)
GPRAPI int grpc_slice_eq(grpc_slice a, grpc_slice b)
static grpc_completion_queue * cq
GPRAPI gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type clock_type)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:06