test-presets-sanity-while-streaming.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: static!
5 //#test:device L500*
6 
7 #include "../func-common.h"
8 #include "presets-common.h"
9 
10 using namespace rs2;
11 
12 TEST_CASE( "presets sanity while streaming", "[l500][live]" )
13 {
15  auto dev = devices[0];
16 
18 
19  auto depth_sens = dev.first< rs2::depth_sensor >();
20 
21  preset_values_map expected_values, expected_defs;
22  build_presets_to_expected_values_defs_map(dev, depth_sens, expected_values, expected_defs);
23 
25 
26  // set preset and mode before stream start
29  depth_sens,
30  expected_values,
31  expected_defs,
32  [&]( preset_mode_pair preset_mode ) { set_mode_preset( depth_sens, preset_mode ); } );
33 
34  // set preset and mode after stream start
37  depth_sens,
38  expected_values,
39  expected_defs,
40  []( preset_mode_pair preset_mode ) {},
41  [&]( preset_mode_pair preset_mode ) { set_mode_preset( depth_sens, preset_mode ); } );
42 }
const std::string MIN_GET_DEFAULT_FW_VERSION("1.5.4.0")
std::pair< rs2_l500_visual_preset, rs2_sensor_mode > preset_mode_pair
std::map< preset_mode_pair, std::map< rs2_option, float > > preset_values_map
void check_presets_values_while_streaming(std::vector< rs2_l500_visual_preset > presets_to_check, const rs2::sensor &sens, preset_values_map &preset_to_expected_values, preset_values_map &preset_to_expected_defaults, std::function< void(preset_mode_pair) > do_before_stream_start=nullptr, std::function< void(preset_mode_pair) > do_after_stream_start=nullptr)
Definition: cah-model.h:10
rs2::device_list find_devices_by_product_line_or_exit(int product)
Definition: func-common.h:24
devices
Definition: test-fg.py:9
#define RS2_PRODUCT_LINE_L500
Definition: rs_context.h:96
TEST_CASE("presets sanity while streaming","[l500][live]")
void exit_if_fw_version_is_under(rs2::device &dev, librealsense::firmware_version version)
Definition: func-common.h:38
void reset_camera_preset_mode_to_defaults(const rs2::sensor &sens)
void build_presets_to_expected_values_defs_map(rs2::device &dev, rs2::depth_sensor &depth_sens, preset_values_map &expected_values, preset_values_map &expected_defs)
void set_mode_preset(const rs2::sensor &sens, preset_mode_pair preset_mode)


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