line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
// Copyright Catch2 Authors |
3
|
|
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. |
4
|
|
|
|
|
|
|
// (See accompanying file LICENSE_1_0.txt or copy at |
5
|
|
|
|
|
|
|
// https://www.boost.org/LICENSE_1_0.txt) |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
// SPDX-License-Identifier: BSL-1.0 |
8
|
|
|
|
|
|
|
#ifndef CATCH_ASSERTION_RESULT_HPP_INCLUDED |
9
|
|
|
|
|
|
|
#define CATCH_ASSERTION_RESULT_HPP_INCLUDED |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#include |
12
|
|
|
|
|
|
|
#include |
13
|
|
|
|
|
|
|
#include |
14
|
|
|
|
|
|
|
#include |
15
|
|
|
|
|
|
|
#include |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#include |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
namespace Catch { |
20
|
|
|
|
|
|
|
|
21
|
224
|
50
|
|
|
|
|
struct AssertionResultData |
22
|
|
|
|
|
|
|
{ |
23
|
|
|
|
|
|
|
AssertionResultData() = delete; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
std::string message; |
28
|
|
|
|
|
|
|
mutable std::string reconstructedExpression; |
29
|
|
|
|
|
|
|
LazyExpression lazyExpression; |
30
|
|
|
|
|
|
|
ResultWas::OfType resultType; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
std::string reconstructExpression() const; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
648
|
|
|
|
|
|
class AssertionResult { |
36
|
|
|
|
|
|
|
public: |
37
|
|
|
|
|
|
|
AssertionResult() = delete; |
38
|
|
|
|
|
|
|
AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
bool isOk() const; |
41
|
|
|
|
|
|
|
bool succeeded() const; |
42
|
|
|
|
|
|
|
ResultWas::OfType getResultType() const; |
43
|
|
|
|
|
|
|
bool hasExpression() const; |
44
|
|
|
|
|
|
|
bool hasMessage() const; |
45
|
|
|
|
|
|
|
std::string getExpression() const; |
46
|
|
|
|
|
|
|
std::string getExpressionInMacro() const; |
47
|
|
|
|
|
|
|
bool hasExpandedExpression() const; |
48
|
|
|
|
|
|
|
std::string getExpandedExpression() const; |
49
|
|
|
|
|
|
|
StringRef getMessage() const; |
50
|
|
|
|
|
|
|
SourceLineInfo getSourceInfo() const; |
51
|
|
|
|
|
|
|
StringRef getTestMacroName() const; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
//protected: |
54
|
|
|
|
|
|
|
AssertionInfo m_info; |
55
|
|
|
|
|
|
|
AssertionResultData m_resultData; |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
} // end namespace Catch |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#endif // CATCH_ASSERTION_RESULT_HPP_INCLUDED |