internal-tests-class-logic.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #include "catch.h"
5 #include <cmath>
6 #include <iostream>
7 #include "./../src/api.h"
8 
9 TEST_CASE("verify_version_compatibility", "[code]")
10 {
11  rs2_error* e = 0;
12  rs2_context* ctx=nullptr;
13 
14  auto runtime_api_version = rs2_get_api_version(&e);
15  CAPTURE(runtime_api_version);
16  REQUIRE(!e);
17 
18  int api_ver = RS2_API_VERSION;
19  int major = (api_ver / 10000);
20  int minor = (api_ver / 100) % 100;
21  int patch = api_ver % 100;
22 
27 
28  // Differences in minor are compatible as long as exe_ver <= lib_ver
29  if (minor > 0)
30  {
32  }
33  if (minor < 99)
34  {
36  }
37 
38  // differences in patch version do not affect compatibility
39  int base = api_ver - patch;
40  for (int i = 0; i < 100; i++)
41  {
42  CAPTURE(base + i);
44  }
45 }
#define RS2_API_VERSION
Definition: rs.h:41
int rs2_get_api_version(rs2_error **error)
Definition: rs.cpp:1184
void verify_version_compatibility(int api_version)
Definition: api.h:463
e
Definition: rmse.py:177
TEST_CASE("verify_version_compatibility","[code]")
#define CAPTURE(...)
Definition: catch.hpp:17432
REQUIRE(n_callbacks==1)
#define REQUIRE_THROWS(...)
Definition: catch.hpp:17401
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO,"Log message using rs2_log()", nullptr))
int i


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