Macros | Functions | Variables
log_test.cc File Reference
#include <stdbool.h>
#include <string.h>
#include <gtest/gtest.h>
#include <grpc/support/log.h>
#include "src/core/lib/gprpp/global_config.h"
#include "test/core/util/test_config.h"
Include dependency graph for log_test.cc:

Go to the source code of this file.

Macros

#define test_log_function_reached(SEVERITY)
 
#define test_log_function_unreached(SEVERITY)
 

Functions

int main (int argc, char **argv)
 
 TEST (LogTest, Basic)
 
 TEST (LogTest, LogVerbosity)
 
static void test_callback (gpr_log_func_args *args)
 
static void test_should_log (gpr_log_func_args *)
 
static void test_should_not_log (gpr_log_func_args *)
 

Variables

static bool log_func_reached = false
 

Macro Definition Documentation

◆ test_log_function_reached

#define test_log_function_reached (   SEVERITY)
Value:
log_func_reached = false; \
gpr_log_message(SEVERITY, "hello 1 2 3"); \
GPR_ASSERT(log_func_reached); \
log_func_reached = false; \
gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3); \
GPR_ASSERT(log_func_reached); \
gpr_set_log_function(nullptr);

Definition at line 45 of file log_test.cc.

◆ test_log_function_unreached

#define test_log_function_unreached (   SEVERITY)
Value:
gpr_log_message(SEVERITY, "hello 1 2 3"); \
gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3); \
gpr_set_log_function(nullptr);

Definition at line 55 of file log_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 91 of file log_test.cc.

◆ TEST() [1/2]

TEST ( LogTest  ,
Basic   
)

Definition at line 61 of file log_test.cc.

◆ TEST() [2/2]

TEST ( LogTest  ,
LogVerbosity   
)

Definition at line 74 of file log_test.cc.

◆ test_callback()

static void test_callback ( gpr_log_func_args args)
static

Definition at line 31 of file log_test.cc.

◆ test_should_log()

static void test_should_log ( gpr_log_func_args )
static

Definition at line 37 of file log_test.cc.

◆ test_should_not_log()

static void test_should_not_log ( gpr_log_func_args )
static

Definition at line 41 of file log_test.cc.

Variable Documentation

◆ log_func_reached

bool log_func_reached = false
static

Definition at line 29 of file log_test.cc.

test_should_log
static void test_should_log(gpr_log_func_args *)
Definition: log_test.cc:37
test_should_not_log
static void test_should_not_log(gpr_log_func_args *)
Definition: log_test.cc:41
gpr_set_log_function
GPRAPI void gpr_set_log_function(gpr_log_func func)
Definition: log.cc:143
log_func_reached
static bool log_func_reached
Definition: log_test.cc:29


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:22