test-cpp-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 TEST_CASE("RESET C++ LOGGER", "[log]") {
9  size_t n_callbacks = 0;
10  auto callback = [&](rs2_log_severity severity, rs2::log_message const& msg)
11  {
12  ++n_callbacks;
13  TRACE(severity << ' ' << msg.filename() << '+' << msg.line_number() << ": " << msg.raw());
14  };
15 
17  REQUIRE(!n_callbacks);
19  log_all();
20  REQUIRE(n_callbacks == 0);
21 
23  REQUIRE(!n_callbacks);
24  log_all();
25  REQUIRE(n_callbacks == 3);
26 
28  log_all();
29  REQUIRE(n_callbacks == 3);
30 
31  n_callbacks = 0;
33  REQUIRE(!n_callbacks);
34  log_all();
35  REQUIRE(n_callbacks == 4);
36 
37  n_callbacks = 0;
39  log_all();
40  REQUIRE(n_callbacks == 0);
41 
42 }
GLenum GLuint GLenum severity
void reset_logger()
Definition: rs.hpp:33
void log_to_callback(rs2_log_severity min_severity, S callback)
Definition: rs.hpp:139
TEST_CASE("RESET C++ LOGGER","[log]")
void log_all()
Definition: log-common.h:35
REQUIRE(n_callbacks==1)
def callback(frame)
Definition: t265_stereo.py:91
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:153


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