Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
func
hw-errors
l500
hw-errors/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
5
#include "../../func-common.h"
6
#include "
l500-error-common.h
"
7
#include "../error-common.h"
8
9
//#test:device L500*
10
11
using namespace
rs2
;
12
13
// Return the same device (the first device found) to avoid unnecessary reinitializations
14
static
rs2::device
get_device
()
15
{
16
static
rs2::device
dev
=
find_devices_by_product_line_or_exit
(
RS2_PRODUCT_LINE_L500
)[0];
17
return
dev
;
18
}
19
20
TEST_CASE
(
"Create device"
,
"[l500][live]"
)
21
{
22
get_device
();
23
}
24
25
TEST_CASE
(
"Non-streaming"
,
"[l500][live]"
)
26
{
27
validate_errors_handling
(
get_device
(),
build_log_errors_map
() );
28
}
29
30
TEST_CASE
(
"Streaming"
,
"[l500][live]"
)
31
{
32
// Require at least one device to be plugged in
33
auto
dev
=
get_device
();
34
auto
depth_sens =
dev
.first<
rs2::depth_sensor
>();
35
36
auto
depth
=
find_default_depth_profile
( depth_sens );
37
auto
ir =
find_default_ir_profile
( depth_sens );
38
auto
confidence
=
find_confidence_corresponding_to_depth
( depth_sens, depth );
39
40
do_while_streaming
( depth_sens, {
depth
, ir,
confidence
}, [&]() {
41
validate_errors_handling
(
dev
,
build_log_errors_map
() );
42
} );
43
}
librealsense::confidence
Definition:
l500-options.h:12
TEST_CASE
TEST_CASE("Create device","[l500][live]")
Definition:
hw-errors/l500/test-sanity.cpp:20
test-bad-conditions.dev
dev
Definition:
test-bad-conditions.py:16
rs2::depth_sensor
Definition:
rs_sensor.hpp:454
l500-error-common.h
find_default_depth_profile
stream_profile find_default_depth_profile(rs2::depth_sensor depth_sens)
Definition:
func-common.h:120
depth
GLint GLint GLsizei GLsizei GLsizei depth
Definition:
glad/glad/glad.h:2399
build_log_errors_map
std::map< uint8_t, std::pair< std::string, rs2_log_severity > > build_log_errors_map()
Definition:
l500-error-common.h:8
rs2
Definition:
cah-model.h:10
do_while_streaming
void do_while_streaming(rs2::sensor depth_sens, std::vector< stream_profile > profiles, std::function< void() > action)
Definition:
func-common.h:214
find_devices_by_product_line_or_exit
rs2::device_list find_devices_by_product_line_or_exit(int product)
Definition:
func-common.h:24
find_default_ir_profile
stream_profile find_default_ir_profile(rs2::depth_sensor depth_sens)
Definition:
func-common.h:134
RS2_PRODUCT_LINE_L500
#define RS2_PRODUCT_LINE_L500
Definition:
rs_context.h:96
validate_errors_handling
void validate_errors_handling(const rs2::device &dev, const std::map< uint8_t, std::pair< std::string, rs2_log_severity > > &error_report)
Definition:
error-common.h:10
find_confidence_corresponding_to_depth
stream_profile find_confidence_corresponding_to_depth(rs2::depth_sensor depth_sens, stream_profile depth_profile)
Definition:
func-common.h:148
get_device
static rs2::device get_device()
Definition:
hw-errors/l500/test-sanity.cpp:14
rs2::device
Definition:
rs_device.hpp:18
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:11