Go to the documentation of this file.
19 #include <gtest/gtest.h>
21 #include "absl/status/status.h"
29 TEST(ErrorUtilsTest, GetErrorGetStatusNone) {
39 TEST(ErrorUtilsTest, GetErrorGetStatusFlat) {
52 TEST(ErrorUtilsTest, GetErrorGetStatusChild) {
53 std::vector<grpc_error_handle>
children = {
70 TEST(ErrorUtilsTest, AbslOkToGrpcError) {
76 TEST(ErrorUtilsTest, GrpcSpecialErrorNoneToAbslStatus) {
83 TEST(ErrorUtilsTest, AbslStatusToGrpcErrorDoesNotReturnSpecialVariables) {
90 TEST(ErrorUtilsTest, GrpcSpecialErrorCancelledToAbslStatus) {
96 TEST(ErrorUtilsTest, GrpcSpecialErrorOOMToAbslStatus) {
103 TEST(ErrorUtilsTest, AbslUnavailableToGrpcError) {
117 TEST(ErrorUtilsTest, GrpcErrorUnavailableToAbslStatus) {
120 "weighted_target: all children report state TRANSIENT_FAILURE"),
125 "weighted_target: all children report state TRANSIENT_FAILURE");
131 int main(
int argc,
char** argv) {
#define ASSERT_NE(val1, val2)
@ GRPC_STATUS_UNAVAILABLE
bool IsUnavailable(const Status &status)
Status CancelledError(absl::string_view message)
#define GRPC_ERROR_CANCELLED
@ GRPC_STATUS_RESOURCE_EXHAUSTED
@ GRPC_ERROR_STR_DESCRIPTION
top-level textual description of this error
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list)
#define TEST(name, init_size,...)
bool IsCancelled(const Status &status)
absl::string_view message() const
bool grpc_error_get_int(grpc_error_handle err, grpc_error_ints which, intptr_t *p)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
int main(int argc, char **argv)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
grpc_error_handle absl_status_to_grpc_error(absl::Status status)
grpc_error_handle grpc_error_set_int(grpc_error_handle src, grpc_error_ints which, intptr_t value)
bool IsResourceExhausted(const Status &status)
#define ASSERT_TRUE(condition)
ABSL_MUST_USE_RESULT bool ok() const
Status UnavailableError(absl::string_view message)
#define GRPC_ERROR_UNREF(err)
void grpc_error_get_status(grpc_error_handle error, grpc_core::Timestamp deadline, grpc_status_code *code, std::string *message, grpc_http2_error_code *http_error, const char **error_string)
bool grpc_error_get_str(grpc_error_handle err, grpc_error_strs which, std::string *s)
Returns false if the specified string is not set.
absl::Status grpc_error_to_absl_status(grpc_error_handle error)
std::map< std::string, Node * > children
@ GRPC_ERROR_INT_GRPC_STATUS
grpc status code representing this error
#define ASSERT_EQ(val1, val2)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:16