test-cpp-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 TEST_CASE( "Logging C++ ERROR", "[log]" ) {
9 
10  size_t n_callbacks = 0;
11  auto callback = [&]( rs2_log_severity severity, rs2::log_message const& msg )
12  {
13  ++n_callbacks;
14  TRACE( severity << ' ' << msg.filename() << '+' << msg.line_number() << ": " << msg.raw() );
15  };
16 
18  REQUIRE( !n_callbacks );
19  log_all();
20  REQUIRE( n_callbacks == 1 );
21 }
TEST_CASE("Logging C++ ERROR","[log]")
GLenum GLuint GLenum severity
void log_to_callback(rs2_log_severity min_severity, S callback)
Definition: rs.hpp:139
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