test-c-reset-logger.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  ++c_n_callbacks;
14  rs2_error* e = nullptr;
15  char const* str = rs2_get_full_log_message(msg, &e);
17  TRACE(str);
18 }
19 
20 TEST_CASE("RESET C LOGGER", "[log]") {
21  c_n_callbacks = 0;
22  rs2_error* e = nullptr;
23 
26  REQUIRE(!c_n_callbacks);
27  rs2_reset_logger(&e);
29  log_all();
30  REQUIRE(c_n_callbacks == 0);
31 
34  log_all();
35  REQUIRE(c_n_callbacks == 3);
36 
37  rs2_reset_logger(&e);
39  c_n_callbacks = 0;
40 
43  REQUIRE(!c_n_callbacks);
44  log_all();
45  REQUIRE(c_n_callbacks == 4);
46 
47  rs2_reset_logger(&e);
49  c_n_callbacks = 0;
50 
53  REQUIRE(!c_n_callbacks);
54  log_all();
55  REQUIRE(c_n_callbacks == 0);
56 }
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
size_t c_n_callbacks
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
TEST_CASE("RESET C LOGGER","[log]")
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
void c_callback(rs2_log_severity severity, rs2_log_message const *msg, void *arg)
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 rs2_reset_logger(rs2_error **error)
Definition: rs.cpp:1308


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