gain-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 digital gain, current and default values
14 // of all the others controls are correct
15 TEST_CASE( "check currents and defaults values after gain changed", "[l500][live]" )
16 {
18  auto dev = devices[0];
19 
21 
22  auto depth_sens = dev.first< rs2::depth_sensor >();
23 
24  auto preset_mode_def = get_camera_preset_mode_defaults( depth_sens );
25 
26  std::map< rs2_option, float > expected_values, expected_defs;
27 
28  build_preset_to_expected_values_map( dev, depth_sens, preset_mode_def, expected_values, expected_defs);
29 
30  for( int gain = RS2_DIGITAL_GAIN_HIGH; gain < RS2_DIGITAL_GAIN_LOW; gain++ )
31  {
33 
34  depth_sens.set_option( RS2_OPTION_DIGITAL_GAIN, gain );
35 
36  expected_values[RS2_OPTION_DIGITAL_GAIN] = gain;
37 
38  compare_to_actual( depth_sens, expected_values, expected_defs);
39  }
40 }
TEST_CASE("check currents and defaults values after gain changed","[l500][live]")
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)
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
void build_preset_to_expected_values_map(rs2::device &dev, rs2::depth_sensor &depth_sens, preset_mode_pair preset_mode, std::map< rs2_option, float > &expected_values, std::map< rs2_option, float > &expected_defs)
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)
preset_mode_pair get_camera_preset_mode_defaults(const rs2::sensor &sens)


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