test-c-warn.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 TEST_CASE( "Logging C WARN", "[log]" ) {
22  c_n_callbacks = 0;
23 
24  rs2_error* e = nullptr;
27  REQUIRE( !c_n_callbacks );
28  log_all();
29  REQUIRE( c_n_callbacks == 2 );
30 }
GLenum GLuint GLenum severity
const char * rs2_get_full_log_message(rs2_log_message const *msg, rs2_error **error)
Definition: rs.cpp:1385
size_t c_n_callbacks
Definition: test-c-warn.cpp:9
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
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))
void c_callback(rs2_log_severity severity, rs2_log_message const *msg, void *arg)
Definition: test-c-warn.cpp:10
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:153
TEST_CASE("Logging C WARN","[log]")
Definition: test-c-warn.cpp:21


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