Classes | Macros | Typedefs | Enumerations | Functions | Variables
unit-tests-common.h File Reference
#include "approx.h"
#include "../include/librealsense2/rs.hpp"
#include "../include/librealsense2/hpp/rs_context.hpp"
#include "../include/librealsense2/hpp/rs_internal.hpp"
#include <limits>
#include <cmath>
#include <cassert>
#include <thread>
#include <map>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <vector>
#include <fstream>
#include <array>
#include "../src/types.h"
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  command_line_params
 
struct  device_profiles
 
struct  frame_metadata
 
struct  internal_frame_additional_data
 
struct  profile
 
class  require_error
 
class  require_no_error
 
struct  stream_request
 
struct  test_duration
 
struct  user_data
 

Macros

#define LIBREALSENSE_UNITTESTS_COMMON_H
 
#define NOEXCEPT_FALSE   noexcept(false)
 
#define SECTION_FROM_TEST_NAME   space_to_underscore(Catch::getCurrentContext().getResultCapture()->getCurrentTestName()).c_str()
 

Typedefs

typedef std::pair< std::string, bool > dev_type
 

Enumerations

enum  special_folder {
  user_desktop, user_documents, user_pictures, user_videos,
  temp_folder
}
 

Functions

void check_fps (double actual_fps, double configured_fps)
 
std::vector< profileconfigure_all_supported_streams (rs2::sensor &sensor, int width=640, int height=480, int fps=60)
 
std::pair< std::vector< rs2::sensor >, std::vector< profile > > configure_all_supported_streams (rs2::device &dev, int width=640, int height=480, int fps=30)
 
void disable_sensitive_options_for (rs2::sensor &sen)
 
void disable_sensitive_options_for (rs2::device &dev)
 
std::shared_ptr< rs2::devicedo_with_waiting_for_camera_connection (rs2::context ctx, std::shared_ptr< rs2::device > dev, std::string serial, std::function< void()> operation)
 
float dot_product (const float(&a)[3], const float(&b)[3])
 
bool file_exists (const std::string &filename)
 
void frame_callback (rs2::device &dev, rs2::frame frame, void *user)
 
dev_type get_PID (rs2::device &dev)
 
rs2::stream_profile get_profile_by_resolution_type (rs2::sensor &s, res_type res)
 
bool is_usb3 (const rs2::device &dev)
 
bool make_context (const char *id, rs2::context *ctx, std::string min_api_version="0.0.0")
 
std::ostream & operator<< (std::ostream &stream, const profile &cap)
 
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])
 
rs2::depth_sensor restart_first_device_and_return_depth_sensor (const rs2::context &ctx, const rs2::device_list &devices_list)
 
std::string space_to_underscore (const std::string &text)
 
void test_option (rs2::sensor &device, rs2_option option, std::initializer_list< int > good_values, std::initializer_list< int > bad_values)
 
float vector_length (const float(&v)[3])
 
bool wait_for_reset (std::function< bool(void)> func, std::shared_ptr< rs2::device > dev)
 

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
 

Macro Definition Documentation

#define LIBREALSENSE_UNITTESTS_COMMON_H

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

#define NOEXCEPT_FALSE   noexcept(false)

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

#define SECTION_FROM_TEST_NAME   space_to_underscore(Catch::getCurrentContext().getResultCapture()->getCurrentTestName()).c_str()

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

Typedef Documentation

typedef std::pair<std::string, bool > dev_type

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

Enumeration Type Documentation

Enumerator
user_desktop 
user_documents 
user_pictures 
user_videos 
temp_folder 

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

Function Documentation

void check_fps ( double  actual_fps,
double  configured_fps 
)
inline

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

std::vector<profile> configure_all_supported_streams ( rs2::sensor sensor,
int  width = 640,
int  height = 480,
int  fps = 60 
)
inline

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

std::pair<std::vector<rs2::sensor>, std::vector<profile> > configure_all_supported_streams ( rs2::device dev,
int  width = 640,
int  height = 480,
int  fps = 30 
)
inline

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

void disable_sensitive_options_for ( rs2::sensor sen)
inline

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

void disable_sensitive_options_for ( rs2::device dev)
inline

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

std::shared_ptr<rs2::device> do_with_waiting_for_camera_connection ( rs2::context  ctx,
std::shared_ptr< rs2::device dev,
std::string  serial,
std::function< void()>  operation 
)
inline

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

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

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

bool file_exists ( const std::string filename)
inline

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

void frame_callback ( rs2::device dev,
rs2::frame  frame,
void user 
)
inline

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

dev_type get_PID ( rs2::device dev)
inline

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

rs2::stream_profile get_profile_by_resolution_type ( rs2::sensor s,
res_type  res 
)
inline

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

bool is_usb3 ( const rs2::device dev)
inline

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

bool make_context ( const char *  id,
rs2::context ctx,
std::string  min_api_version = "0.0.0" 
)
inline

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

std::ostream& operator<< ( std::ostream &  stream,
const profile cap 
)
inline

Definition at line 87 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 432 of file unit-tests-common.h.

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

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

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

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

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

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

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

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

rs2::depth_sensor restart_first_device_and_return_depth_sensor ( const rs2::context ctx,
const rs2::device_list devices_list 
)
inline

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

std::string space_to_underscore ( const std::string text)
inline

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

void test_option ( rs2::sensor device,
rs2_option  option,
std::initializer_list< int >  good_values,
std::initializer_list< int >  bad_values 
)
inline

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

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

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

bool wait_for_reset ( std::function< bool(void)>  func,
std::shared_ptr< rs2::device dev 
)
inline

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

Variable Documentation

std::mutex cb_mtx
static

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

std::condition_variable cv
static

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

int done
static

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

std::mutex m
static

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

const int max_capture_time_sec = 3

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

const uint32_t max_frames_to_receive = 50

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

std::atomic<bool> stop_streaming
static

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



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