ADTF
Loading...
Searching...
No Matches
catch_integration.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <a_utils.h>
10#include <catch2/catch.hpp>
11
12CATCH_TRANSLATE_EXCEPTION(const tResult& oError)
13{
14 return adtf::util::to_string(oError).GetPtr();
15}
16
17namespace Catch
18{
19
23template<>
24struct StringMaker<tResult>
25{
26 static std::string convert(const tResult& oError)
27 {
28 return adtf::util::to_string(oError).GetPtr();
29 }
30};
31
35template<tErrorCode::error_code_type Code>
36struct StringMaker<tError<Code>>
37{
38 static std::string convert(const tError<Code>&)
39 {
40 return tError<Code>::str_error_code;
41 }
42};
43
47template<>
48struct StringMaker<adtf::util::cString>
49{
50 static std::string convert(const adtf::util::cString& strString)
51 {
52 return strString.GetPtr();
53 }
54};
55
59template<>
60struct StringMaker<adtf::util::cFilename>
61{
62 static std::string convert(const adtf::util::cFilename& strString)
63 {
64 return strString.GetPtr();
65 }
66};
67
68} // namespace Catch
69
75#define REQUIRE_OK(...) REQUIRE(tResult(ERR_NOERROR) == __VA_ARGS__)
81#define REQUIRE_FAILED(...) REQUIRE(tResult(ERR_NOERROR) != __VA_ARGS__)
82
88#define CHECK_OK(...) CHECK(tResult(ERR_NOERROR) == __VA_ARGS__)
94#define CHECK_FAILED(...) CHECK(tResult(ERR_NOERROR) != __VA_ARGS__)
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
Namespace for all functionality provided by catch2 integration in adtf::testing.
Definition catch_integration.h:18
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14