Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
func
mur
l500
mur/l500/test-sanity.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
// Test group description:
10
// * This tests group verifies depth sensor max usable range option restrictions,
11
// according to [RS-8358]
12
//
13
// Current test description:
14
// * All conditions for Max Usable Range set, try to get MUR value while not streaming (should throw).
15
// * All conditions for Max Usable Range set and depth sensor is streaming, verify calling success.
16
//
17
// Note: * L515 specific test
18
// * Test will pass if no L515 device is connected
19
// * Test will be performed on the first L515 device detected.
20
21
TEST_CASE
(
"Streaming - Sanity"
,
"[max-usable-range]"
)
22
{
23
auto
depth_sensor
24
=
find_first_supported_depth_sensor_or_exit
(
"L515"
,
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
);
25
auto
mur =
depth_sensor
.
as
<
rs2::max_usable_range_sensor
>();
26
REQUIRE
(mur);
27
mur.set_option(
RS2_OPTION_VISUAL_PRESET
,
RS2_L500_VISUAL_PRESET_MAX_RANGE
);
28
29
auto
depth_vga_profile
30
=
get_profile_by_stream_parameters
( mur,
RS2_STREAM_DEPTH
,
RS2_FORMAT_Z16
, 640, 480, 30 );
31
32
REQUIRE
( depth_vga_profile );
33
34
mur.set_option(
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
, 1.
f
);
35
36
float
mur_val = 0.0f;
37
CHECK_THROWS
(mur.get_max_usable_depth_range());
// Verify function throws when not streaming
38
39
mur.open( depth_vga_profile );
40
mur.start( [](
rs2::frame
f
) {} );
41
42
43
CHECK_NOTHROW
( mur_val = mur.get_max_usable_depth_range() );
44
CHECK
( 0 != mur_val );
45
46
mur.stop();
47
mur.close();
48
}
rs2::frame
Definition:
rs_frame.hpp:343
RS2_L500_VISUAL_PRESET_MAX_RANGE
Definition:
rs_option.h:157
TEST_CASE
TEST_CASE("Streaming - Sanity","[max-usable-range]")
Definition:
mur/l500/test-sanity.cpp:21
rs2::depth_sensor
Definition:
rs_sensor.hpp:454
RS2_FORMAT_Z16
Definition:
rs_sensor.h:62
f
GLdouble f
Definition:
glad/glad/glad.h:1518
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
CHECK_THROWS
#define CHECK_THROWS(...)
Definition:
catch.hpp:17415
RS2_STREAM_DEPTH
Definition:
rs_sensor.h:45
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
Definition:
rs_option.h:106
CHECK_NOTHROW
#define CHECK_NOTHROW(...)
Definition:
catch.hpp:17421
CHECK
#define CHECK(condition)
Definition:
easylogging++.h:4483
RS2_OPTION_VISUAL_PRESET
Definition:
rs_option.h:36
get_profile_by_stream_parameters
rs2::stream_profile get_profile_by_stream_parameters(rs2::sensor s, rs2_stream stream=RS2_STREAM_ANY, rs2_format format=RS2_FORMAT_ANY, int width=-1, int height=-1, int fps=-1, int stream_index=-1)
Definition:
func-common.h:227
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:11