Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
func
mur
l500
mur/l500/test-dependencies.cpp
Go to the documentation of this file.
1
// License: Apache 2.0. See LICENSE file in root directory.
2
// Copyright(c) 2021 Intel Corporation. All Rights Reserved.
3
4
//#test:tag max-usable-range
5
//#test:device L500*
6
7
#include "../../func-common.h"
8
9
10
// Test group description:
11
// * This tests group verifies depth sensor max usable range option restrictions,
12
// according to [RS-8358]
13
//
14
// Current test description:
15
// * While not streaming, activating Max Usable Range option should make sure the visual preset is 'Max Range'
16
// and sensor mode is 'VGA'
17
// if it is not it will set the visual preset to max range and the sensor mode to 'VGA'
18
// * Reading Max Usable Range while Max Usable Range option is off or not streaming - expect exception thrown
19
//
20
// Note: * L515 specific test
21
// * Test will pass if no L515 device is connected
22
// * Test will be performed on the first L515 device detected.
23
24
TEST_CASE
(
"Max Usable Range option change visual preset and sensor mode if not streaming"
,
"[max-usable-range]"
)
25
{
26
auto
depth_sensor
27
=
find_first_supported_depth_sensor_or_exit
(
"L515"
,
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
);
28
auto
mur =
depth_sensor
.
as
<
rs2::max_usable_range_sensor
>();
29
REQUIRE
(mur);
30
mur.set_option(
RS2_OPTION_SENSOR_MODE
,
RS2_SENSOR_MODE_XGA
);
31
mur.set_option(
RS2_OPTION_VISUAL_PRESET
,
RS2_L500_VISUAL_PRESET_SHORT_RANGE
);
32
CHECK_NOTHROW
( mur.set_option(
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
, 1.f ) );
33
CHECK
(
RS2_L500_VISUAL_PRESET_MAX_RANGE
== mur.get_option(
RS2_OPTION_VISUAL_PRESET
) );
34
CHECK
(
RS2_SENSOR_MODE_VGA
== mur.get_option(
RS2_OPTION_SENSOR_MODE
) );
35
36
}
37
RS2_L500_VISUAL_PRESET_MAX_RANGE
Definition:
rs_option.h:157
RS2_SENSOR_MODE_XGA
Definition:
rs_option.h:168
rs2::depth_sensor
Definition:
rs_sensor.hpp:454
RS2_SENSOR_MODE_VGA
Definition:
rs_option.h:167
TEST_CASE
TEST_CASE("Max Usable Range option change visual preset and sensor mode if not streaming","[max-usable-range]")
Definition:
mur/l500/test-dependencies.cpp:24
REQUIRE
REQUIRE(n_callbacks==1)
find_first_supported_depth_sensor_or_exit
rs2::depth_sensor find_first_supported_depth_sensor_or_exit(const std::string &dev_name, rs2_option opt)
Definition:
func-common.h:77
rs2::sensor::as
T as() const
Definition:
rs_sensor.hpp:333
rs2::max_usable_range_sensor
Definition:
rs_sensor.hpp:728
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
Definition:
rs_option.h:106
CHECK_NOTHROW
#define CHECK_NOTHROW(...)
Definition:
catch.hpp:17421
RS2_L500_VISUAL_PRESET_SHORT_RANGE
Definition:
rs_option.h:158
CHECK
#define CHECK(condition)
Definition:
easylogging++.h:4483
RS2_OPTION_VISUAL_PRESET
Definition:
rs_option.h:36
RS2_OPTION_SENSOR_MODE
Definition:
rs_option.h:95
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:11