Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
func
reflectivity
l500
reflectivity/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 reflectivity
5
//#test:device L500*
6
7
#include "../../func-common.h"
8
9
// Test group description:
10
// * This tests group verifies IR reflectivity option restrictions,
11
// according to [RS-8358].
12
//
13
// Current test description:
14
// * All conditions for IR Reflectivity set, verify enabling option succeed.
15
// * All conditions for IR Reflectivity set and depth sensor is streaming, verify enabling option succeed.
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
(
"Not streaming - sanity"
,
"[reflectivity]"
)
22
{
23
auto
ds
24
=
find_first_supported_depth_sensor_or_exit
(
"L515"
,
RS2_OPTION_ENABLE_IR_REFLECTIVITY
);
25
26
// Verify alt IR is off
27
if
(
ds
.supports(
RS2_OPTION_ALTERNATE_IR
) )
28
ds
.set_option(
RS2_OPTION_ALTERNATE_IR
, 0 );
29
30
ds
.set_option(
RS2_OPTION_SENSOR_MODE
,
RS2_SENSOR_MODE_VGA
);
31
ds
.set_option(
RS2_OPTION_VISUAL_PRESET
,
RS2_L500_VISUAL_PRESET_MAX_RANGE
);
32
CHECK_NOTHROW
(
ds
.set_option(
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
, 1.f ) );
33
CHECK_NOTHROW
(
ds
.set_option(
RS2_OPTION_ENABLE_IR_REFLECTIVITY
, 1.f ) );
34
CHECK
(
ds
.get_option(
RS2_OPTION_ENABLE_IR_REFLECTIVITY
) );
35
}
36
37
TEST_CASE
(
"Streaming - sanity"
,
"[reflectivity]"
)
38
{
39
auto
ds
40
=
find_first_supported_depth_sensor_or_exit
(
"L515"
,
RS2_OPTION_ENABLE_IR_REFLECTIVITY
);
41
42
// Verify alt IR is off
43
if
(
ds
.supports(
RS2_OPTION_ALTERNATE_IR
))
44
ds
.set_option(
RS2_OPTION_ALTERNATE_IR
, 0);
45
46
ds
.set_option(
RS2_OPTION_SENSOR_MODE
,
RS2_SENSOR_MODE_VGA
);
47
ds
.set_option(
RS2_OPTION_VISUAL_PRESET
,
RS2_L500_VISUAL_PRESET_MAX_RANGE
);
48
CHECK_NOTHROW
(
ds
.set_option(
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
, 1.f));
49
50
auto
depth_vga_profile
51
=
get_profile_by_stream_parameters
(
ds
,
RS2_STREAM_DEPTH
,
RS2_FORMAT_Z16
, 640, 480, 30 );
52
53
REQUIRE
(depth_vga_profile);
54
55
ds
.open(depth_vga_profile);
56
ds
.start([](
rs2::frame
f
) {});
57
58
CHECK_NOTHROW
(
ds
.set_option(
RS2_OPTION_ENABLE_IR_REFLECTIVITY
, 1.f));
59
CHECK
(
ds
.get_option(
RS2_OPTION_ENABLE_IR_REFLECTIVITY
));
60
61
ds
.stop();
62
ds
.close();
63
}
64
rs2::frame
Definition:
rs_frame.hpp:343
RS2_L500_VISUAL_PRESET_MAX_RANGE
Definition:
rs_option.h:157
RS2_FORMAT_Z16
Definition:
rs_sensor.h:62
RS2_SENSOR_MODE_VGA
Definition:
rs_option.h:167
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_OPTION_ENABLE_IR_REFLECTIVITY
Definition:
rs_option.h:109
RS2_STREAM_DEPTH
Definition:
rs_sensor.h:45
test_sensor_first_frame_delay.ds
ds
Definition:
test_sensor_first_frame_delay.py:75
RS2_OPTION_ALTERNATE_IR
Definition:
rs_option.h:107
RS2_OPTION_ENABLE_MAX_USABLE_RANGE
Definition:
rs_option.h:106
CHECK_NOTHROW
#define CHECK_NOTHROW(...)
Definition:
catch.hpp:17421
TEST_CASE
TEST_CASE("Not streaming - sanity","[reflectivity]")
Definition:
reflectivity/l500/test-sanity.cpp:21
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
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