Classes | Defines | Functions | Variables
unit-tests-common.h File Reference
#include "catch/catch.hpp"
#include <librealsense/rs.h>
#include <limits>
#include <cmath>
#include <cassert>
#include <thread>
#include <map>
#include <mutex>
#include <condition_variable>
#include <atomic>
Include dependency graph for unit-tests-common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  require_error
class  require_no_error
class  safe_context
struct  stream_mode
struct  test_duration
struct  user_data

Defines

#define NOEXCEPT_FALSE   noexcept(false)

Functions

void check_fps (double actual_fps, double configured_fps)
float dot_product (const float(&a)[3], const float(&b)[3])
void frame_callback (rs_device *dev, rs_frame_ref *frame, void *user)
void motion_callback (rs_device *, rs_motion_data, void *)
void require_cross_product (const float(&r)[3], const float(&a)[3], const float(&b)[3])
void require_identity_matrix (const float(&matrix)[9])
void require_rotation_matrix (const float(&matrix)[9])
void require_transposed (const float(&a)[9], const float(&b)[9])
void require_zero_vector (const float(&vector)[3])
void test_frame_callback (rs_device *device, std::initializer_list< stream_mode > &modes, std::map< rs_stream, test_duration > &duration_per_stream)
void test_option (rs_device *device, rs_option option, std::initializer_list< int > good_values, std::initializer_list< int > bad_values)
void test_streaming (rs_device *device, std::initializer_list< stream_mode > modes)
void test_wait_for_frames (rs_device *device, std::initializer_list< stream_mode > &modes, std::map< rs_stream, test_duration > &duration_per_stream)
void timestamp_callback (rs_device *, rs_timestamp_data, void *)
float vector_length (const float(&v)[3])

Variables

static std::mutex cb_mtx
static std::condition_variable cv
static int done
static std::mutex m
const int max_capture_time_sec = 3
const uint32_t max_frames_to_receive = 50
static std::atomic< bool > stop_streaming

Define Documentation

#define NOEXCEPT_FALSE   noexcept(false)

Definition at line 28 of file unit-tests-common.h.


Function Documentation

void check_fps ( double  actual_fps,
double  configured_fps 
) [inline]

Definition at line 170 of file unit-tests-common.h.

float dot_product ( const float(&)  a[3],
const float(&)  b[3] 
) [inline]

Definition at line 98 of file unit-tests-common.h.

void frame_callback ( rs_device dev,
rs_frame_ref frame,
void user 
) [inline]

Definition at line 267 of file unit-tests-common.h.

void motion_callback ( rs_device ,
rs_motion_data  ,
void  
) [inline]

Definition at line 375 of file unit-tests-common.h.

void require_cross_product ( const float(&)  r[3],
const float(&)  a[3],
const float(&)  b[3] 
) [inline]

Definition at line 110 of file unit-tests-common.h.

void require_identity_matrix ( const float(&)  matrix[9]) [inline]

Definition at line 155 of file unit-tests-common.h.

void require_rotation_matrix ( const float(&)  matrix[9]) [inline]

Definition at line 138 of file unit-tests-common.h.

void require_transposed ( const float(&)  a[9],
const float(&)  b[9] 
) [inline]

Definition at line 124 of file unit-tests-common.h.

void require_zero_vector ( const float(&)  vector[3]) [inline]

Definition at line 118 of file unit-tests-common.h.

void test_frame_callback ( rs_device device,
std::initializer_list< stream_mode > &  modes,
std::map< rs_stream, test_duration > &  duration_per_stream 
) [inline]

Definition at line 337 of file unit-tests-common.h.

void test_option ( rs_device device,
rs_option  option,
std::initializer_list< int good_values,
std::initializer_list< int bad_values 
) [inline]

Definition at line 405 of file unit-tests-common.h.

void test_streaming ( rs_device device,
std::initializer_list< stream_mode modes 
) [inline]

Definition at line 384 of file unit-tests-common.h.

void test_wait_for_frames ( rs_device device,
std::initializer_list< stream_mode > &  modes,
std::map< rs_stream, test_duration > &  duration_per_stream 
) [inline]

Definition at line 181 of file unit-tests-common.h.

void timestamp_callback ( rs_device ,
rs_timestamp_data  ,
void  
) [inline]

Definition at line 379 of file unit-tests-common.h.

float vector_length ( const float(&)  v[3]) [inline]

Definition at line 104 of file unit-tests-common.h.


Variable Documentation

std::mutex cb_mtx [static]

Definition at line 257 of file unit-tests-common.h.

std::condition_variable cv [static]

Definition at line 258 of file unit-tests-common.h.

int done [static]

Definition at line 260 of file unit-tests-common.h.

std::mutex m [static]

Definition at line 256 of file unit-tests-common.h.

Definition at line 178 of file unit-tests-common.h.

const uint32_t max_frames_to_receive = 50

Definition at line 179 of file unit-tests-common.h.

std::atomic<bool> stop_streaming [static]

Definition at line 259 of file unit-tests-common.h.



librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Tue Jun 25 2019 19:54:40