test-c-error.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 == (void*) 0xbadf00d );
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 ERROR", "[log]" ) {
23  c_n_callbacks = 0;
24 
25  rs2_error* e = nullptr;
26  rs2_log_to_callback( RS2_LOG_SEVERITY_ERROR, c_callback, ( void * ) 0xbadf00d, &e );
28  REQUIRE( !c_n_callbacks );
29  log_all();
30  REQUIRE( c_n_callbacks == 1 );
31 }
GLenum GLuint GLenum severity
const char * rs2_get_full_log_message(rs2_log_message const *msg, rs2_error **error)
Definition: rs.cpp:1385
void c_callback(rs2_log_severity severity, rs2_log_message const *msg, void *arg)
Definition: arg_fwd.hpp:23
e
Definition: rmse.py:177
TEST_CASE("Logging C ERROR","[log]")
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
static void handle(rs2_error *e)
Definition: rs_types.hpp:144
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
size_t c_n_callbacks
Definition: test-c-error.cpp:9


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