mode-change/test-values.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 #include <l500/l500-options.h>
10 
11 using namespace rs2;
12 
13 // This test checks that after changing resolution, current and default values
14 // of all the others controls are correct
15 TEST_CASE( "check currents after resolution changed", "[l500][live]" )
16 {
18  auto dev = devices[0];
19 
21 
22  auto depth_sens = dev.first< rs2::depth_sensor >();
23 
24  preset_values_map expected_values, expected_defs;
25  build_presets_to_expected_values_defs_map(dev, depth_sens, expected_values, expected_defs);
26 
27  // print_presets_to_csv( depth_sens, preset_to_expected_map );
29  depth_sens.set_option( RS2_OPTION_VISUAL_PRESET, (float)preset_mode.first);
30  depth_sens.set_option( RS2_OPTION_SENSOR_MODE, preset_mode.second);
31 
32  CAPTURE(preset_mode);
33 
34  depth_sens.set_option( RS2_OPTION_SENSOR_MODE, preset_mode.second);
35 
36  compare_to_actual(depth_sens, expected_values[preset_mode], expected_defs[preset_mode]);
37  } );
38 }
const std::string MIN_GET_DEFAULT_FW_VERSION("1.5.4.0")
void compare_to_actual(const rs2::sensor &sens, const std::map< rs2_option, float > &expected_values, const std::map< rs2_option, float > &expected_defaults)
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
Definition: cah-model.h:10
#define CAPTURE(...)
Definition: catch.hpp:17432
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("check currents after resolution changed","[l500][live]")
void exit_if_fw_version_is_under(rs2::device &dev, librealsense::firmware_version version)
Definition: func-common.h:38
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 for_each_preset_mode_combination(std::function< void(preset_mode_pair) > action)


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