test-c-debug.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 //#cmake:add-file log-common.h
5 #include "log-common.h"
6 
7 
8 // See log_callback_function_ptr
9 size_t c_n_callbacks = 0;
11 {
12  REQUIRE( !arg );
13 
14  ++c_n_callbacks;
15  rs2_error* e = nullptr;
16  char const* str = rs2_get_full_log_message( msg, &e );
18  TRACE( str );
19 }
20 
21 
22 TEST_CASE( "Logging C DEBUG", "[log]" ) {
23  c_n_callbacks = 0;
24 
25  rs2_error* e = nullptr;
28  REQUIRE( !c_n_callbacks );
29  log_all();
30  REQUIRE( c_n_callbacks == 4 );
31 }
GLenum GLuint GLenum severity
const char * rs2_get_full_log_message(rs2_log_message const *msg, rs2_error **error)
Definition: rs.cpp:1385
Definition: arg_fwd.hpp:23
e
Definition: rmse.py:177
void log_all()
Definition: log-common.h:35
void rs2_log_to_callback(rs2_log_severity min_severity, rs2_log_callback_ptr callback, void *arg, rs2_error **error)
Definition: rs.cpp:1351
REQUIRE(n_callbacks==1)
struct rs2_log_message rs2_log_message
Definition: rs_types.h:259
TEST_CASE("Logging C DEBUG","[log]")
static void handle(rs2_error *e)
Definition: rs_types.hpp:144
size_t c_n_callbacks
Definition: test-c-debug.cpp:9
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO,"Log message using rs2_log()", nullptr))
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:153
void c_callback(rs2_log_severity severity, rs2_log_message const *msg, void *arg)


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11