#include <cmath>
#include <iostream>
#include <chrono>
#include <ctime>
#include <algorithm>
#include "unit-tests-common.h"
#include "../include/librealsense2/rs_advanced_mode.hpp"
#include "../include/librealsense2/hpp/rs_frame.hpp"
#include "../include/librealsense2/hpp/rs_processing.hpp"
#include <../src/proc/synthetic-stream.h>
#include <../src/proc/disparity-transform.h>
#include <../src/proc/spatial-filter.h>
#include <../src/proc/temporal-filter.h>
Go to the source code of this file.
Classes | |
struct | device_profiles |
struct | stream_format |
struct | stream_request |
struct | test_profile |
Macros | |
#define | SECTION_FROM_TEST_NAME space_to_underscore(Catch::getCurrentContext().getResultCapture()->getCurrentTestName()).c_str() |
Typedefs | |
typedef std::pair< std::string, bool > | dev_type |
Functions | |
void | check_controls_sanity (const rs2::context &ctx, const sensor &dev) |
std::shared_ptr< std::function< void(rs2::frame fref)> > | check_stream_sanity (const rs2::context &ctx, const rs2::sensor &sub, int num_of_frames, bool infinite=false) |
bool | compare (const rs2_extrinsics &first, const rs2_extrinsics &second, double delta=0) |
std::vector< test_profile > | configure_all_supported_streams (rs2::sensor &sensor, int width=640, int height=480, int fps=60) |
std::pair< std::vector< rs2::sensor >, std::vector< test_profile > > | configure_all_supported_streams (rs2::device &dev, int width=640, int height=480, int fps=30) |
long long | current_time () |
void | dev_changed (rs2_device_list *removed_devs, rs2_device_list *added_devs, void *ptr) |
void | disable_sensitive_options_for (sensor &sen) |
void | disable_sensitive_options_for (rs2::device &dev) |
std::shared_ptr< device > | do_with_waiting_for_camera_connection (rs2::context ctx, std::shared_ptr< device > dev, std::string serial, std::function< void()> operation) |
bool | get_mode (rs2::device &dev, rs2::stream_profile *profile, int mode_index=0) |
dev_type | get_PID (rs2::device &dev) |
bool | is_usb3 (const rs2::device &dev) |
std::pair< std::shared_ptr< rs2::device >, std::weak_ptr< rs2::device > > | make_device (device_list &list) |
void | metadata_verification (const std::vector< internal_frame_additional_data > &data) |
bool | operator== (std::vector< test_profile > streams1, std::vector< test_profile > streams2) |
void | require_pipeline_profile_same (const rs2::pipeline_profile &profile1, const rs2::pipeline_profile &profile2) |
void | reset_device (std::shared_ptr< rs2::device > &strong, std::weak_ptr< rs2::device > &weak, device_list &list, const rs2::device &new_dev) |
TEST_CASE ("Sync sanity","[live]") | |
TEST_CASE ("Sync different fps","[live][!mayfail]") | |
TEST_CASE ("Sync start stop","[live]") | |
TEST_CASE ("Device metadata enumerates correctly","[live]") | |
TEST_CASE ("Start-Stop stream sequence","[live]") | |
TEST_CASE ("No extrinsic transformation between a stream and itself","[live]") | |
TEST_CASE ("Extrinsic transformation between two streams is a rigid transform","[live]") | |
TEST_CASE ("Extrinsic transformations are transitive","[live]") | |
TEST_CASE ("Toggle Advanced Mode","[live][AdvMd]") | |
TEST_CASE ("Advanced Mode presets","[live][AdvMd]") | |
TEST_CASE ("Advanced Mode JSON","[live][AdvMd]") | |
TEST_CASE ("Advanced Mode controls","[live][AdvMd]") | |
TEST_CASE ("Streaming modes sanity check","[live][!mayfail]") | |
TEST_CASE ("Motion profiles sanity","[live]") | |
TEST_CASE ("Check width and height of stream intrinsics","[live][AdvMd]") | |
TEST_CASE ("Check option API","[live][options]") | |
TEST_CASE ("Multiple devices","[live][multicam][!mayfail]") | |
TEST_CASE ("Multiple applications","[live][multicam][!mayfail]") | |
TEST_CASE ("Error handling sanity","[live][!mayfail]") | |
TEST_CASE ("Auto disabling control behavior","[live]") | |
TEST_CASE ("Disconnect events works","[live]") | |
TEST_CASE ("Connect events works","[live]") | |
TEST_CASE ("Connect Disconnect events while streaming","[live]") | |
TEST_CASE ("Connect Disconnect events while controls","[live]") | |
TEST_CASE ("Basic device_hub flow","[live][!mayfail]") | |
TEST_CASE ("Auto-complete feature works","[offline][util::config]") | |
TEST_CASE ("Pipeline wait_for_frames","[live]") | |
TEST_CASE ("Pipeline poll_for_frames","[live]") | |
TEST_CASE ("Pipeline enable stream","[live]") | |
TEST_CASE ("Pipeline enable stream auto complete","[live]") | |
TEST_CASE ("Pipeline disable_all","[live]") | |
TEST_CASE ("Pipeline disable stream","[live]") | |
TEST_CASE ("Pipeline with specific device","[live]") | |
TEST_CASE ("Pipeline start stop","[live]") | |
TEST_CASE ("Pipeline get selection","[live]") | |
TEST_CASE ("Per-frame metadata sanity check","[live][!mayfail]") | |
TEST_CASE ("All suggested profiles can be opened","[live][!mayfail]") | |
TEST_CASE ("Pipeline config enable resolve start flow","[live]") | |
TEST_CASE ("Pipeline - multicam scenario with specific devices","[live][multicam]") | |
TEST_CASE ("Empty Pipeline Profile","[live]") | |
TEST_CASE ("Pipeline empty Config","[live]") | |
TEST_CASE ("Pipeline 2 Configs","[live]") | |
TEST_CASE ("Pipeline start after resolve uses the same profile","[live]") | |
TEST_CASE ("Pipeline start ignores previous config if it was changed","[live]") | |
TEST_CASE ("Pipeline Config disable all is a nop with empty config","[live]") | |
TEST_CASE ("Pipeline Config disable each stream is nop on empty config","[live]") | |
TEST_CASE ("Pipeline record and playback","[live]") | |
TEST_CASE ("Syncer sanity with software-device device","[live][software-device]") | |
TEST_CASE ("Syncer clean_inactive_streams by frame number with software-device device","[live][software-device]") | |
TEST_CASE ("C API Compilation","[live]") | |
void | trigger_error (const rs2::device &dev, int num) |
void | validate (std::vector< std::vector< rs2::stream_profile >> frames, std::vector< std::vector< double >> timestamps, device_profiles requests, int actual_fps) |
bool | wait_for_reset (std::function< bool(void)> func, std::shared_ptr< device > dev) |
Variables | |
static const std::map< dev_type, device_profiles > | pipeline_autocomplete_configurations |
static const std::map< dev_type, device_profiles > | pipeline_configurations_for_extrinsic |
static const std::map< dev_type, device_profiles > | pipeline_custom_configurations |
static const std::map< dev_type, device_profiles > | pipeline_default_configurations |
#define SECTION_FROM_TEST_NAME space_to_underscore(Catch::getCurrentContext().getResultCapture()->getCurrentTestName()).c_str() |
Definition at line 27 of file unit-tests-internal.cpp.
typedef std::pair<std::string, bool > dev_type |
Definition at line 91 of file unit-tests-internal.cpp.
void check_controls_sanity | ( | const rs2::context & | ctx, |
const sensor & | dev | ||
) |
Definition at line 2398 of file unit-tests-internal.cpp.
std::shared_ptr<std::function<void(rs2::frame fref)> > check_stream_sanity | ( | const rs2::context & | ctx, |
const rs2::sensor & | sub, | ||
int | num_of_frames, | ||
bool | infinite = false |
||
) |
Definition at line 2253 of file unit-tests-internal.cpp.
bool compare | ( | const rs2_extrinsics & | first, |
const rs2_extrinsics & | second, | ||
double | delta = 0 |
||
) |
Definition at line 3442 of file unit-tests-internal.cpp.
std::vector<test_profile> configure_all_supported_streams | ( | rs2::sensor & | sensor, |
int | width = 640 , |
||
int | height = 480 , |
||
int | fps = 60 |
||
) |
Definition at line 163 of file unit-tests-internal.cpp.
std::pair<std::vector<rs2::sensor>, std::vector<test_profile> > configure_all_supported_streams | ( | rs2::device & | dev, |
int | width = 640 , |
||
int | height = 480 , |
||
int | fps = 30 |
||
) |
Definition at line 209 of file unit-tests-internal.cpp.
long long current_time | ( | ) |
Definition at line 29 of file unit-tests-internal.cpp.
void dev_changed | ( | rs2_device_list * | removed_devs, |
rs2_device_list * | added_devs, | ||
void * | ptr | ||
) |
Definition at line 4405 of file unit-tests-internal.cpp.
Definition at line 36 of file unit-tests-internal.cpp.
void disable_sensitive_options_for | ( | rs2::device & | dev | ) |
Definition at line 52 of file unit-tests-internal.cpp.
std::shared_ptr<device> do_with_waiting_for_camera_connection | ( | rs2::context | ctx, |
std::shared_ptr< device > | dev, | ||
std::string | serial, | ||
std::function< void()> | operation | ||
) |
Definition at line 768 of file unit-tests-internal.cpp.
bool get_mode | ( | rs2::device & | dev, |
rs2::stream_profile * | profile, | ||
int | mode_index = 0 |
||
) |
Definition at line 432 of file unit-tests-internal.cpp.
dev_type get_PID | ( | rs2::device & | dev | ) |
Definition at line 93 of file unit-tests-internal.cpp.
bool is_usb3 | ( | const rs2::device & | dev | ) |
Definition at line 74 of file unit-tests-internal.cpp.
std::pair<std::shared_ptr<rs2::device>, std::weak_ptr<rs2::device> > make_device | ( | device_list & | list | ) |
Definition at line 2088 of file unit-tests-internal.cpp.
void metadata_verification | ( | const std::vector< internal_frame_additional_data > & | data | ) |
Definition at line 1903 of file unit-tests-internal.cpp.
bool operator== | ( | std::vector< test_profile > | streams1, |
std::vector< test_profile > | streams2 | ||
) |
Definition at line 3340 of file unit-tests-internal.cpp.
void require_pipeline_profile_same | ( | const rs2::pipeline_profile & | profile1, |
const rs2::pipeline_profile & | profile2 | ||
) |
Definition at line 3986 of file unit-tests-internal.cpp.
void reset_device | ( | std::shared_ptr< rs2::device > & | strong, |
std::weak_ptr< rs2::device > & | weak, | ||
device_list & | list, | ||
const rs2::device & | new_dev | ||
) |
Definition at line 2101 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Sync sanity" | , |
"" | [live] | ||
) |
Definition at line 227 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Sync different fps" | , |
"" | [live][!mayfail] | ||
) |
Definition at line 311 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Sync start stop" | , |
"" | [live] | ||
) |
Definition at line 451 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Device metadata enumerates correctly" | , |
"" | [live] | ||
) |
Definition at line 542 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Start-Stop stream sequence" | , |
"" | [live] | ||
) |
Definition at line 570 of file unit-tests-internal.cpp.
TEST_CASE | ( | "No extrinsic transformation between a stream and itself" | , |
"" | [live] | ||
) |
Definition at line 606 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Extrinsic transformation between two streams is a rigid transform" | , |
"" | [live] | ||
) |
Definition at line 641 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Extrinsic transformations are transitive" | , |
"" | [live] | ||
) |
Definition at line 700 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Toggle Advanced Mode" | , |
"" | [live][AdvMd] | ||
) |
Definition at line 814 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Advanced Mode presets" | , |
"" | [live][AdvMd] | ||
) |
Definition at line 859 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Advanced Mode JSON" | , |
"" | [live][AdvMd] | ||
) |
Definition at line 939 of file unit-tests-internal.cpp.
Definition at line 1002 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Streaming modes sanity check" | , |
"" | [live][!mayfail] | ||
) |
Definition at line 1190 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Motion profiles sanity" | , |
"" | [live] | ||
) |
Definition at line 1286 of file unit-tests-internal.cpp.
Definition at line 1342 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Check option API" | , |
"" | [live][options] | ||
) |
Definition at line 1421 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Multiple devices" | , |
"" | [live][multicam][!mayfail] | ||
) |
The test may fail due to changes in profiles list that do not indicate regression. TODO - refactoring required to make the test agnostic to changes imposed by librealsense core
Definition at line 1556 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Multiple applications" | , |
"" | [live][multicam][!mayfail] | ||
) |
Definition at line 1722 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Error handling sanity" | , |
"" | [live][!mayfail] | ||
) |
Definition at line 1959 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Auto disabling control behavior" | , |
"" | [live] | ||
) |
Definition at line 2021 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Disconnect events works" | , |
"" | [live] | ||
) |
Definition at line 2111 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Connect events works" | , |
"" | [live] | ||
) |
Definition at line 2184 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Connect Disconnect events while streaming" | , |
"" | [live] | ||
) |
Definition at line 2317 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Connect Disconnect events while controls" | , |
"" | [live] | ||
) |
Definition at line 2410 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Basic device_hub flow" | , |
"" | [live][!mayfail] | ||
) |
Definition at line 2481 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Auto-complete feature works" | , |
"" | [offline][util::config] | ||
) |
Definition at line 2527 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline wait_for_frames" | , |
"" | [live] | ||
) |
Definition at line 2810 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline poll_for_frames" | , |
"" | [live] | ||
) |
Definition at line 2876 of file unit-tests-internal.cpp.
Definition at line 2969 of file unit-tests-internal.cpp.
Definition at line 3066 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline disable_all" | , |
"" | [live] | ||
) |
Definition at line 3141 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline disable stream" | , |
"" | [live] | ||
) |
Definition at line 3219 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline with specific device" | , |
"" | [live] | ||
) |
Definition at line 3298 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline start stop" | , |
"" | [live] | ||
) |
Definition at line 3360 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline get selection" | , |
"" | [live] | ||
) |
Definition at line 3502 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Per-frame metadata sanity check" | , |
"" | [live][!mayfail] | ||
) |
Definition at line 3563 of file unit-tests-internal.cpp.
TEST_CASE | ( | "All suggested profiles can be opened" | , |
"" | [live][!mayfail] | ||
) |
Definition at line 3735 of file unit-tests-internal.cpp.
Definition at line 3771 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline - multicam scenario with specific devices" | , |
"" | [live][multicam] | ||
) |
Definition at line 3839 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Empty Pipeline Profile" | , |
"" | [live] | ||
) |
Definition at line 3961 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline empty Config" | , |
"" | [live] | ||
) |
Definition at line 4039 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline 2 Configs" | , |
"" | [live] | ||
) |
Definition at line 4059 of file unit-tests-internal.cpp.
Definition at line 4087 of file unit-tests-internal.cpp.
Definition at line 4106 of file unit-tests-internal.cpp.
Definition at line 4122 of file unit-tests-internal.cpp.
Definition at line 4141 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Pipeline record and playback" | , |
"" | [live] | ||
) |
Definition at line 4164 of file unit-tests-internal.cpp.
Definition at line 4210 of file unit-tests-internal.cpp.
TEST_CASE | ( | "Syncer clean_inactive_streams by frame number with software-device device" | , |
"" | [live][software-device] | ||
) |
Definition at line 4304 of file unit-tests-internal.cpp.
TEST_CASE | ( | "C API Compilation" | , |
"" | [live] | ||
) |
Definition at line 4406 of file unit-tests-internal.cpp.
void trigger_error | ( | const rs2::device & | dev, |
int | num | ||
) |
Definition at line 1945 of file unit-tests-internal.cpp.
void validate | ( | std::vector< std::vector< rs2::stream_profile >> | frames, |
std::vector< std::vector< double >> | timestamps, | ||
device_profiles | requests, | ||
int | actual_fps | ||
) |
Definition at line 2689 of file unit-tests-internal.cpp.
Definition at line 58 of file unit-tests-internal.cpp.
|
static |
Definition at line 3042 of file unit-tests-internal.cpp.
|
static |
Definition at line 3462 of file unit-tests-internal.cpp.
|
static |
Definition at line 2944 of file unit-tests-internal.cpp.
|
static |
Definition at line 2791 of file unit-tests-internal.cpp.