test-profile-eq.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #include "../func/func-common.h"
5 #include "../../include/librealsense2/hpp/rs_frame.hpp"
6 #include <iostream>
7 
8 using namespace rs2;
9 
10 TEST_CASE("test video_stream_profile operator==", "[live]")
11 {
12  // Test that for 2 video_stream_profile objects, if width and height are different
13  // then, video_stream_profile.operator== returns false.
14 
16  if (devices.size() == 0) return;
17  auto dev = devices[0];
18 
19  auto depth_sens = dev.first< rs2::depth_sensor >();
20 
21  stream_profile profile0, profile1;
22  std::vector< stream_profile > stream_profiles;
23  REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles());
24  for (auto profile : stream_profiles)
25  {
26  if (profile.is<video_stream_profile>())
27  {
28  profile0 = profile;
29  }
30  }
31  if (!profile0) return;
32  video_stream_profile vprofile0 = profile0.as<video_stream_profile>();
33 
34  for (auto profile : stream_profiles)
35  {
36  if (!profile.is<video_stream_profile>()) continue;
37  if (profile == profile0)
38  {
40  if (vprofile0.width() == vprofile.width() &&
41  vprofile0.height() == vprofile.height())
42  {
43  REQUIRE(vprofile0 == vprofile);
44  }
45  else
46  {
47  REQUIRE(!(vprofile0 == vprofile));
48  }
49  }
50  }
51 }
Definition: cah-model.h:10
REQUIRE(n_callbacks==1)
rs2::device_list find_devices_by_product_line_or_exit(int product)
Definition: func-common.h:24
devices
Definition: test-fg.py:9
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
Definition: streaming.h:165
#define RS2_PRODUCT_LINE_DEPTH
Definition: rs_context.h:98
TEST_CASE("test video_stream_profile operator==","[live]")
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO,"Log message using rs2_log()", nullptr))


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11