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
26  REQUIRE(mur);
28 
29  auto depth_vga_profile
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 }
TEST_CASE("Streaming - Sanity","[max-usable-range]")
GLdouble f
REQUIRE(n_callbacks==1)
rs2::depth_sensor find_first_supported_depth_sensor_or_exit(const std::string &dev_name, rs2_option opt)
Definition: func-common.h:77
T as() const
Definition: rs_sensor.hpp:333
#define CHECK_THROWS(...)
Definition: catch.hpp:17415
#define CHECK_NOTHROW(...)
Definition: catch.hpp:17421
#define CHECK(condition)
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