explodethosebits 0.3.0__cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- etb/__init__.py +351 -0
- etb/__init__.pyi +976 -0
- etb/_etb.cpython-39-x86_64-linux-gnu.so +0 -0
- etb/_version.py +34 -0
- etb/py.typed +2 -0
- explodethosebits-0.3.0.dist-info/METADATA +405 -0
- explodethosebits-0.3.0.dist-info/RECORD +88 -0
- explodethosebits-0.3.0.dist-info/WHEEL +6 -0
- explodethosebits-0.3.0.dist-info/licenses/LICENSE +21 -0
- explodethosebits-0.3.0.dist-info/sboms/auditwheel.cdx.json +1 -0
- explodethosebits.libs/libcudart-c3a75b33.so.12.8.90 +0 -0
- include/etb/bit_coordinate.hpp +45 -0
- include/etb/bit_extraction.hpp +79 -0
- include/etb/bit_pruning.hpp +122 -0
- include/etb/config.hpp +284 -0
- include/etb/cuda/arch_optimizations.cuh +358 -0
- include/etb/cuda/blackwell_optimizations.cuh +300 -0
- include/etb/cuda/cuda_common.cuh +265 -0
- include/etb/cuda/etb_cuda.cuh +200 -0
- include/etb/cuda/gpu_memory.cuh +406 -0
- include/etb/cuda/heuristics_kernel.cuh +315 -0
- include/etb/cuda/path_generator_kernel.cuh +272 -0
- include/etb/cuda/prefix_pruner_kernel.cuh +370 -0
- include/etb/cuda/signature_kernel.cuh +328 -0
- include/etb/early_stopping.hpp +246 -0
- include/etb/etb.hpp +20 -0
- include/etb/heuristics.hpp +165 -0
- include/etb/memoization.hpp +285 -0
- include/etb/path.hpp +86 -0
- include/etb/path_count.hpp +87 -0
- include/etb/path_generator.hpp +175 -0
- include/etb/prefix_trie.hpp +339 -0
- include/etb/reporting.hpp +437 -0
- include/etb/scoring.hpp +269 -0
- include/etb/signature.hpp +190 -0
- include/gmock/gmock-actions.h +2297 -0
- include/gmock/gmock-cardinalities.h +159 -0
- include/gmock/gmock-function-mocker.h +518 -0
- include/gmock/gmock-matchers.h +5623 -0
- include/gmock/gmock-more-actions.h +658 -0
- include/gmock/gmock-more-matchers.h +120 -0
- include/gmock/gmock-nice-strict.h +277 -0
- include/gmock/gmock-spec-builders.h +2148 -0
- include/gmock/gmock.h +96 -0
- include/gmock/internal/custom/README.md +18 -0
- include/gmock/internal/custom/gmock-generated-actions.h +7 -0
- include/gmock/internal/custom/gmock-matchers.h +37 -0
- include/gmock/internal/custom/gmock-port.h +40 -0
- include/gmock/internal/gmock-internal-utils.h +487 -0
- include/gmock/internal/gmock-port.h +139 -0
- include/gmock/internal/gmock-pp.h +279 -0
- include/gtest/gtest-assertion-result.h +237 -0
- include/gtest/gtest-death-test.h +345 -0
- include/gtest/gtest-matchers.h +923 -0
- include/gtest/gtest-message.h +252 -0
- include/gtest/gtest-param-test.h +546 -0
- include/gtest/gtest-printers.h +1161 -0
- include/gtest/gtest-spi.h +250 -0
- include/gtest/gtest-test-part.h +192 -0
- include/gtest/gtest-typed-test.h +331 -0
- include/gtest/gtest.h +2321 -0
- include/gtest/gtest_pred_impl.h +279 -0
- include/gtest/gtest_prod.h +60 -0
- include/gtest/internal/custom/README.md +44 -0
- include/gtest/internal/custom/gtest-port.h +37 -0
- include/gtest/internal/custom/gtest-printers.h +42 -0
- include/gtest/internal/custom/gtest.h +37 -0
- include/gtest/internal/gtest-death-test-internal.h +307 -0
- include/gtest/internal/gtest-filepath.h +227 -0
- include/gtest/internal/gtest-internal.h +1560 -0
- include/gtest/internal/gtest-param-util.h +1026 -0
- include/gtest/internal/gtest-port-arch.h +122 -0
- include/gtest/internal/gtest-port.h +2481 -0
- include/gtest/internal/gtest-string.h +178 -0
- include/gtest/internal/gtest-type-util.h +220 -0
- lib/libetb_core.a +0 -0
- lib64/cmake/GTest/GTestConfig.cmake +33 -0
- lib64/cmake/GTest/GTestConfigVersion.cmake +43 -0
- lib64/cmake/GTest/GTestTargets-release.cmake +49 -0
- lib64/cmake/GTest/GTestTargets.cmake +139 -0
- lib64/libgmock.a +0 -0
- lib64/libgmock_main.a +0 -0
- lib64/libgtest.a +0 -0
- lib64/libgtest_main.a +0 -0
- lib64/pkgconfig/gmock.pc +10 -0
- lib64/pkgconfig/gmock_main.pc +10 -0
- lib64/pkgconfig/gtest.pc +9 -0
- lib64/pkgconfig/gtest_main.pc +10 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// Copyright 2007, Google Inc.
|
|
2
|
+
// All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
|
5
|
+
// modification, are permitted provided that the following conditions are
|
|
6
|
+
// met:
|
|
7
|
+
//
|
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
12
|
+
// in the documentation and/or other materials provided with the
|
|
13
|
+
// distribution.
|
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
|
16
|
+
// this software without specific prior written permission.
|
|
17
|
+
//
|
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
|
|
30
|
+
// Google Mock - a framework for writing C++ mock classes.
|
|
31
|
+
//
|
|
32
|
+
// This file implements some commonly used cardinalities. More
|
|
33
|
+
// cardinalities can be defined by the user implementing the
|
|
34
|
+
// CardinalityInterface interface if necessary.
|
|
35
|
+
|
|
36
|
+
// IWYU pragma: private, include "gmock/gmock.h"
|
|
37
|
+
// IWYU pragma: friend gmock/.*
|
|
38
|
+
|
|
39
|
+
#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
|
|
40
|
+
#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
|
|
41
|
+
|
|
42
|
+
#include <limits.h>
|
|
43
|
+
|
|
44
|
+
#include <memory>
|
|
45
|
+
#include <ostream> // NOLINT
|
|
46
|
+
|
|
47
|
+
#include "gmock/internal/gmock-port.h"
|
|
48
|
+
#include "gtest/gtest.h"
|
|
49
|
+
|
|
50
|
+
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
|
|
51
|
+
/* class A needs to have dll-interface to be used by clients of class B */)
|
|
52
|
+
|
|
53
|
+
namespace testing {
|
|
54
|
+
|
|
55
|
+
// To implement a cardinality Foo, define:
|
|
56
|
+
// 1. a class FooCardinality that implements the
|
|
57
|
+
// CardinalityInterface interface, and
|
|
58
|
+
// 2. a factory function that creates a Cardinality object from a
|
|
59
|
+
// const FooCardinality*.
|
|
60
|
+
//
|
|
61
|
+
// The two-level delegation design follows that of Matcher, providing
|
|
62
|
+
// consistency for extension developers. It also eases ownership
|
|
63
|
+
// management as Cardinality objects can now be copied like plain values.
|
|
64
|
+
|
|
65
|
+
// The implementation of a cardinality.
|
|
66
|
+
class CardinalityInterface {
|
|
67
|
+
public:
|
|
68
|
+
virtual ~CardinalityInterface() = default;
|
|
69
|
+
|
|
70
|
+
// Conservative estimate on the lower/upper bound of the number of
|
|
71
|
+
// calls allowed.
|
|
72
|
+
virtual int ConservativeLowerBound() const { return 0; }
|
|
73
|
+
virtual int ConservativeUpperBound() const { return INT_MAX; }
|
|
74
|
+
|
|
75
|
+
// Returns true if and only if call_count calls will satisfy this
|
|
76
|
+
// cardinality.
|
|
77
|
+
virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
|
|
78
|
+
|
|
79
|
+
// Returns true if and only if call_count calls will saturate this
|
|
80
|
+
// cardinality.
|
|
81
|
+
virtual bool IsSaturatedByCallCount(int call_count) const = 0;
|
|
82
|
+
|
|
83
|
+
// Describes self to an ostream.
|
|
84
|
+
virtual void DescribeTo(::std::ostream* os) const = 0;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// A Cardinality is a copyable and IMMUTABLE (except by assignment)
|
|
88
|
+
// object that specifies how many times a mock function is expected to
|
|
89
|
+
// be called. The implementation of Cardinality is just a std::shared_ptr
|
|
90
|
+
// to const CardinalityInterface. Don't inherit from Cardinality!
|
|
91
|
+
class GTEST_API_ Cardinality {
|
|
92
|
+
public:
|
|
93
|
+
// Constructs a null cardinality. Needed for storing Cardinality
|
|
94
|
+
// objects in STL containers.
|
|
95
|
+
Cardinality() = default;
|
|
96
|
+
|
|
97
|
+
// Constructs a Cardinality from its implementation.
|
|
98
|
+
explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
|
|
99
|
+
|
|
100
|
+
// Conservative estimate on the lower/upper bound of the number of
|
|
101
|
+
// calls allowed.
|
|
102
|
+
int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
|
|
103
|
+
int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
|
|
104
|
+
|
|
105
|
+
// Returns true if and only if call_count calls will satisfy this
|
|
106
|
+
// cardinality.
|
|
107
|
+
bool IsSatisfiedByCallCount(int call_count) const {
|
|
108
|
+
return impl_->IsSatisfiedByCallCount(call_count);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Returns true if and only if call_count calls will saturate this
|
|
112
|
+
// cardinality.
|
|
113
|
+
bool IsSaturatedByCallCount(int call_count) const {
|
|
114
|
+
return impl_->IsSaturatedByCallCount(call_count);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Returns true if and only if call_count calls will over-saturate this
|
|
118
|
+
// cardinality, i.e. exceed the maximum number of allowed calls.
|
|
119
|
+
bool IsOverSaturatedByCallCount(int call_count) const {
|
|
120
|
+
return impl_->IsSaturatedByCallCount(call_count) &&
|
|
121
|
+
!impl_->IsSatisfiedByCallCount(call_count);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Describes self to an ostream
|
|
125
|
+
void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
|
|
126
|
+
|
|
127
|
+
// Describes the given actual call count to an ostream.
|
|
128
|
+
static void DescribeActualCallCountTo(int actual_call_count,
|
|
129
|
+
::std::ostream* os);
|
|
130
|
+
|
|
131
|
+
private:
|
|
132
|
+
std::shared_ptr<const CardinalityInterface> impl_;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Creates a cardinality that allows at least n calls.
|
|
136
|
+
GTEST_API_ Cardinality AtLeast(int n);
|
|
137
|
+
|
|
138
|
+
// Creates a cardinality that allows at most n calls.
|
|
139
|
+
GTEST_API_ Cardinality AtMost(int n);
|
|
140
|
+
|
|
141
|
+
// Creates a cardinality that allows any number of calls.
|
|
142
|
+
GTEST_API_ Cardinality AnyNumber();
|
|
143
|
+
|
|
144
|
+
// Creates a cardinality that allows between min and max calls.
|
|
145
|
+
GTEST_API_ Cardinality Between(int min, int max);
|
|
146
|
+
|
|
147
|
+
// Creates a cardinality that allows exactly n calls.
|
|
148
|
+
GTEST_API_ Cardinality Exactly(int n);
|
|
149
|
+
|
|
150
|
+
// Creates a cardinality from its implementation.
|
|
151
|
+
inline Cardinality MakeCardinality(const CardinalityInterface* c) {
|
|
152
|
+
return Cardinality(c);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
} // namespace testing
|
|
156
|
+
|
|
157
|
+
GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
|
|
158
|
+
|
|
159
|
+
#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
|
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
// Copyright 2007, Google Inc.
|
|
2
|
+
// All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
|
5
|
+
// modification, are permitted provided that the following conditions are
|
|
6
|
+
// met:
|
|
7
|
+
//
|
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
12
|
+
// in the documentation and/or other materials provided with the
|
|
13
|
+
// distribution.
|
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
|
16
|
+
// this software without specific prior written permission.
|
|
17
|
+
//
|
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
|
|
30
|
+
// Google Mock - a framework for writing C++ mock classes.
|
|
31
|
+
//
|
|
32
|
+
// This file implements MOCK_METHOD.
|
|
33
|
+
|
|
34
|
+
// IWYU pragma: private, include "gmock/gmock.h"
|
|
35
|
+
// IWYU pragma: friend gmock/.*
|
|
36
|
+
|
|
37
|
+
#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_
|
|
38
|
+
#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_
|
|
39
|
+
|
|
40
|
+
#include <type_traits> // IWYU pragma: keep
|
|
41
|
+
#include <utility> // IWYU pragma: keep
|
|
42
|
+
|
|
43
|
+
#include "gmock/gmock-spec-builders.h"
|
|
44
|
+
#include "gmock/internal/gmock-internal-utils.h"
|
|
45
|
+
#include "gmock/internal/gmock-pp.h"
|
|
46
|
+
|
|
47
|
+
namespace testing {
|
|
48
|
+
namespace internal {
|
|
49
|
+
template <typename T>
|
|
50
|
+
using identity_t = T;
|
|
51
|
+
|
|
52
|
+
template <typename Pattern>
|
|
53
|
+
struct ThisRefAdjuster {
|
|
54
|
+
template <typename T>
|
|
55
|
+
using AdjustT = typename std::conditional<
|
|
56
|
+
std::is_const<typename std::remove_reference<Pattern>::type>::value,
|
|
57
|
+
typename std::conditional<std::is_lvalue_reference<Pattern>::value,
|
|
58
|
+
const T&, const T&&>::type,
|
|
59
|
+
typename std::conditional<std::is_lvalue_reference<Pattern>::value, T&,
|
|
60
|
+
T&&>::type>::type;
|
|
61
|
+
|
|
62
|
+
template <typename MockType>
|
|
63
|
+
static AdjustT<MockType> Adjust(const MockType& mock) {
|
|
64
|
+
return static_cast<AdjustT<MockType>>(const_cast<MockType&>(mock));
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
constexpr bool PrefixOf(const char* a, const char* b) {
|
|
69
|
+
return *a == 0 || (*a == *b && internal::PrefixOf(a + 1, b + 1));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
template <int N, int M>
|
|
73
|
+
constexpr bool StartsWith(const char (&prefix)[N], const char (&str)[M]) {
|
|
74
|
+
return N <= M && internal::PrefixOf(prefix, str);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
template <int N, int M>
|
|
78
|
+
constexpr bool EndsWith(const char (&suffix)[N], const char (&str)[M]) {
|
|
79
|
+
return N <= M && internal::PrefixOf(suffix, str + M - N);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
template <int N, int M>
|
|
83
|
+
constexpr bool Equals(const char (&a)[N], const char (&b)[M]) {
|
|
84
|
+
return N == M && internal::PrefixOf(a, b);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
template <int N>
|
|
88
|
+
constexpr bool ValidateSpec(const char (&spec)[N]) {
|
|
89
|
+
return internal::Equals("const", spec) ||
|
|
90
|
+
internal::Equals("override", spec) ||
|
|
91
|
+
internal::Equals("final", spec) ||
|
|
92
|
+
internal::Equals("noexcept", spec) ||
|
|
93
|
+
(internal::StartsWith("noexcept(", spec) &&
|
|
94
|
+
internal::EndsWith(")", spec)) ||
|
|
95
|
+
internal::Equals("ref(&)", spec) ||
|
|
96
|
+
internal::Equals("ref(&&)", spec) ||
|
|
97
|
+
(internal::StartsWith("Calltype(", spec) &&
|
|
98
|
+
internal::EndsWith(")", spec));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
} // namespace internal
|
|
102
|
+
|
|
103
|
+
// The style guide prohibits "using" statements in a namespace scope
|
|
104
|
+
// inside a header file. However, the FunctionMocker class template
|
|
105
|
+
// is meant to be defined in the ::testing namespace. The following
|
|
106
|
+
// line is just a trick for working around a bug in MSVC 8.0, which
|
|
107
|
+
// cannot handle it if we define FunctionMocker in ::testing.
|
|
108
|
+
using internal::FunctionMocker;
|
|
109
|
+
} // namespace testing
|
|
110
|
+
|
|
111
|
+
#define MOCK_METHOD(...) \
|
|
112
|
+
GMOCK_INTERNAL_WARNING_PUSH() \
|
|
113
|
+
GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-member-function") \
|
|
114
|
+
GMOCK_PP_VARIADIC_CALL(GMOCK_INTERNAL_MOCK_METHOD_ARG_, __VA_ARGS__) \
|
|
115
|
+
GMOCK_INTERNAL_WARNING_POP()
|
|
116
|
+
|
|
117
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...) \
|
|
118
|
+
GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
|
|
119
|
+
|
|
120
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_2(...) \
|
|
121
|
+
GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
|
|
122
|
+
|
|
123
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_3(_Ret, _MethodName, _Args) \
|
|
124
|
+
GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, ())
|
|
125
|
+
|
|
126
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, _Spec) \
|
|
127
|
+
GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Args); \
|
|
128
|
+
GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Spec); \
|
|
129
|
+
GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE( \
|
|
130
|
+
GMOCK_PP_NARG0 _Args, GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)); \
|
|
131
|
+
GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec) \
|
|
132
|
+
GMOCK_INTERNAL_MOCK_METHOD_IMPL( \
|
|
133
|
+
GMOCK_PP_NARG0 _Args, _MethodName, GMOCK_INTERNAL_HAS_CONST(_Spec), \
|
|
134
|
+
GMOCK_INTERNAL_HAS_OVERRIDE(_Spec), GMOCK_INTERNAL_HAS_FINAL(_Spec), \
|
|
135
|
+
GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Spec), \
|
|
136
|
+
GMOCK_INTERNAL_GET_CALLTYPE_SPEC(_Spec), \
|
|
137
|
+
GMOCK_INTERNAL_GET_REF_SPEC(_Spec), \
|
|
138
|
+
(GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)))
|
|
139
|
+
|
|
140
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_5(...) \
|
|
141
|
+
GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
|
|
142
|
+
|
|
143
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_6(...) \
|
|
144
|
+
GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
|
|
145
|
+
|
|
146
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_7(...) \
|
|
147
|
+
GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
|
|
148
|
+
|
|
149
|
+
#define GMOCK_INTERNAL_WRONG_ARITY(...) \
|
|
150
|
+
static_assert( \
|
|
151
|
+
false, \
|
|
152
|
+
"MOCK_METHOD must be called with 3 or 4 arguments. _Ret, " \
|
|
153
|
+
"_MethodName, _Args and optionally _Spec. _Args and _Spec must be " \
|
|
154
|
+
"enclosed in parentheses. If _Ret is a type with unprotected commas, " \
|
|
155
|
+
"it must also be enclosed in parentheses.")
|
|
156
|
+
|
|
157
|
+
#define GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple) \
|
|
158
|
+
static_assert( \
|
|
159
|
+
GMOCK_PP_IS_ENCLOSED_PARENS(_Tuple), \
|
|
160
|
+
GMOCK_PP_STRINGIZE(_Tuple) " should be enclosed in parentheses.")
|
|
161
|
+
|
|
162
|
+
#define GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N, ...) \
|
|
163
|
+
static_assert( \
|
|
164
|
+
std::is_function<__VA_ARGS__>::value, \
|
|
165
|
+
"Signature must be a function type, maybe return type contains " \
|
|
166
|
+
"unprotected comma."); \
|
|
167
|
+
static_assert( \
|
|
168
|
+
::testing::tuple_size<typename ::testing::internal::Function< \
|
|
169
|
+
__VA_ARGS__>::ArgumentTuple>::value == _N, \
|
|
170
|
+
"This method does not take " GMOCK_PP_STRINGIZE( \
|
|
171
|
+
_N) " arguments. Parenthesize all types with unprotected commas.")
|
|
172
|
+
|
|
173
|
+
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec) \
|
|
174
|
+
GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT, ~, _Spec)
|
|
175
|
+
|
|
176
|
+
#define GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness, \
|
|
177
|
+
_Override, _Final, _NoexceptSpec, \
|
|
178
|
+
_CallType, _RefSpec, _Signature) \
|
|
179
|
+
typename ::testing::internal::Function<GMOCK_PP_REMOVE_PARENS( \
|
|
180
|
+
_Signature)>::Result \
|
|
181
|
+
GMOCK_INTERNAL_EXPAND(_CallType) \
|
|
182
|
+
_MethodName(GMOCK_PP_REPEAT(GMOCK_INTERNAL_PARAMETER, _Signature, _N)) \
|
|
183
|
+
GMOCK_PP_IF(_Constness, const, ) \
|
|
184
|
+
_RefSpec _NoexceptSpec GMOCK_PP_IF(_Override, override, ) \
|
|
185
|
+
GMOCK_PP_IF(_Final, final, ) { \
|
|
186
|
+
GMOCK_MOCKER_(_N, _Constness, _MethodName) \
|
|
187
|
+
.SetOwnerAndName(this, #_MethodName); \
|
|
188
|
+
return GMOCK_MOCKER_(_N, _Constness, _MethodName) \
|
|
189
|
+
.Invoke(GMOCK_PP_REPEAT(GMOCK_INTERNAL_FORWARD_ARG, _Signature, _N)); \
|
|
190
|
+
} \
|
|
191
|
+
::testing::MockSpec<GMOCK_PP_REMOVE_PARENS(_Signature)> gmock_##_MethodName( \
|
|
192
|
+
GMOCK_PP_REPEAT(GMOCK_INTERNAL_MATCHER_PARAMETER, _Signature, _N)) \
|
|
193
|
+
GMOCK_PP_IF(_Constness, const, ) _RefSpec { \
|
|
194
|
+
GMOCK_MOCKER_(_N, _Constness, _MethodName).RegisterOwner(this); \
|
|
195
|
+
return GMOCK_MOCKER_(_N, _Constness, _MethodName) \
|
|
196
|
+
.With(GMOCK_PP_REPEAT(GMOCK_INTERNAL_MATCHER_ARGUMENT, , _N)); \
|
|
197
|
+
} \
|
|
198
|
+
::testing::MockSpec<GMOCK_PP_REMOVE_PARENS(_Signature)> gmock_##_MethodName( \
|
|
199
|
+
const ::testing::internal::WithoutMatchers&, \
|
|
200
|
+
GMOCK_PP_IF(_Constness, const, )::testing::internal::Function< \
|
|
201
|
+
GMOCK_PP_REMOVE_PARENS(_Signature)>*) const _RefSpec _NoexceptSpec { \
|
|
202
|
+
return ::testing::internal::ThisRefAdjuster<GMOCK_PP_IF( \
|
|
203
|
+
_Constness, const, ) int _RefSpec>::Adjust(*this) \
|
|
204
|
+
.gmock_##_MethodName(GMOCK_PP_REPEAT( \
|
|
205
|
+
GMOCK_INTERNAL_A_MATCHER_ARGUMENT, _Signature, _N)); \
|
|
206
|
+
} \
|
|
207
|
+
mutable ::testing::FunctionMocker<GMOCK_PP_REMOVE_PARENS(_Signature)> \
|
|
208
|
+
GMOCK_MOCKER_(_N, _Constness, _MethodName)
|
|
209
|
+
|
|
210
|
+
#define GMOCK_INTERNAL_EXPAND(...) __VA_ARGS__
|
|
211
|
+
|
|
212
|
+
// Valid modifiers.
|
|
213
|
+
#define GMOCK_INTERNAL_HAS_CONST(_Tuple) \
|
|
214
|
+
GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_CONST, ~, _Tuple))
|
|
215
|
+
|
|
216
|
+
#define GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple) \
|
|
217
|
+
GMOCK_PP_HAS_COMMA( \
|
|
218
|
+
GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_OVERRIDE, ~, _Tuple))
|
|
219
|
+
|
|
220
|
+
#define GMOCK_INTERNAL_HAS_FINAL(_Tuple) \
|
|
221
|
+
GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_FINAL, ~, _Tuple))
|
|
222
|
+
|
|
223
|
+
#define GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Tuple) \
|
|
224
|
+
GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT, ~, _Tuple)
|
|
225
|
+
|
|
226
|
+
#define GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT(_i, _, _elem) \
|
|
227
|
+
GMOCK_PP_IF( \
|
|
228
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)), \
|
|
229
|
+
_elem, )
|
|
230
|
+
|
|
231
|
+
#define GMOCK_INTERNAL_GET_CALLTYPE_SPEC(_Tuple) \
|
|
232
|
+
GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_CALLTYPE_SPEC_IF_CALLTYPE, ~, _Tuple)
|
|
233
|
+
|
|
234
|
+
#define GMOCK_INTERNAL_CALLTYPE_SPEC_IF_CALLTYPE(_i, _, _elem) \
|
|
235
|
+
GMOCK_PP_IF( \
|
|
236
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem)), \
|
|
237
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_UNPACK_, _elem), )
|
|
238
|
+
|
|
239
|
+
#define GMOCK_INTERNAL_GET_REF_SPEC(_Tuple) \
|
|
240
|
+
GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_REF_SPEC_IF_REF, ~, _Tuple)
|
|
241
|
+
|
|
242
|
+
#define GMOCK_INTERNAL_REF_SPEC_IF_REF(_i, _, _elem) \
|
|
243
|
+
GMOCK_PP_IF(GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)), \
|
|
244
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_UNPACK_, _elem), )
|
|
245
|
+
|
|
246
|
+
#ifdef GMOCK_INTERNAL_STRICT_SPEC_ASSERT
|
|
247
|
+
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem) \
|
|
248
|
+
static_assert( \
|
|
249
|
+
::testing::internal::ValidateSpec(GMOCK_PP_STRINGIZE(_elem)), \
|
|
250
|
+
"Token \'" GMOCK_PP_STRINGIZE( \
|
|
251
|
+
_elem) "\' cannot be recognized as a valid specification " \
|
|
252
|
+
"modifier. Is a ',' missing?");
|
|
253
|
+
#else
|
|
254
|
+
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem) \
|
|
255
|
+
static_assert( \
|
|
256
|
+
(GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)) + \
|
|
257
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)) + \
|
|
258
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)) + \
|
|
259
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)) + \
|
|
260
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)) + \
|
|
261
|
+
GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem))) == 1, \
|
|
262
|
+
GMOCK_PP_STRINGIZE( \
|
|
263
|
+
_elem) " cannot be recognized as a valid specification modifier.");
|
|
264
|
+
#endif // GMOCK_INTERNAL_STRICT_SPEC_ASSERT
|
|
265
|
+
|
|
266
|
+
// Modifiers implementation.
|
|
267
|
+
#define GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem) \
|
|
268
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CONST_I_, _elem)
|
|
269
|
+
|
|
270
|
+
#define GMOCK_INTERNAL_DETECT_CONST_I_const ,
|
|
271
|
+
|
|
272
|
+
#define GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem) \
|
|
273
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_OVERRIDE_I_, _elem)
|
|
274
|
+
|
|
275
|
+
#define GMOCK_INTERNAL_DETECT_OVERRIDE_I_override ,
|
|
276
|
+
|
|
277
|
+
#define GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem) \
|
|
278
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_FINAL_I_, _elem)
|
|
279
|
+
|
|
280
|
+
#define GMOCK_INTERNAL_DETECT_FINAL_I_final ,
|
|
281
|
+
|
|
282
|
+
#define GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem) \
|
|
283
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_NOEXCEPT_I_, _elem)
|
|
284
|
+
|
|
285
|
+
#define GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept ,
|
|
286
|
+
|
|
287
|
+
#define GMOCK_INTERNAL_DETECT_REF(_i, _, _elem) \
|
|
288
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_REF_I_, _elem)
|
|
289
|
+
|
|
290
|
+
#define GMOCK_INTERNAL_DETECT_REF_I_ref ,
|
|
291
|
+
|
|
292
|
+
#define GMOCK_INTERNAL_UNPACK_ref(x) x
|
|
293
|
+
|
|
294
|
+
#define GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem) \
|
|
295
|
+
GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CALLTYPE_I_, _elem)
|
|
296
|
+
|
|
297
|
+
#define GMOCK_INTERNAL_DETECT_CALLTYPE_I_Calltype ,
|
|
298
|
+
|
|
299
|
+
#define GMOCK_INTERNAL_UNPACK_Calltype(...) __VA_ARGS__
|
|
300
|
+
|
|
301
|
+
// Note: The use of `identity_t` here allows _Ret to represent return types that
|
|
302
|
+
// would normally need to be specified in a different way. For example, a method
|
|
303
|
+
// returning a function pointer must be written as
|
|
304
|
+
//
|
|
305
|
+
// fn_ptr_return_t (*method(method_args_t...))(fn_ptr_args_t...)
|
|
306
|
+
//
|
|
307
|
+
// But we only support placing the return type at the beginning. To handle this,
|
|
308
|
+
// we wrap all calls in identity_t, so that a declaration will be expanded to
|
|
309
|
+
//
|
|
310
|
+
// identity_t<fn_ptr_return_t (*)(fn_ptr_args_t...)> method(method_args_t...)
|
|
311
|
+
//
|
|
312
|
+
// This allows us to work around the syntactic oddities of function/method
|
|
313
|
+
// types.
|
|
314
|
+
#define GMOCK_INTERNAL_SIGNATURE(_Ret, _Args) \
|
|
315
|
+
::testing::internal::identity_t<GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(_Ret), \
|
|
316
|
+
GMOCK_PP_REMOVE_PARENS, \
|
|
317
|
+
GMOCK_PP_IDENTITY)(_Ret)>( \
|
|
318
|
+
GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GET_TYPE, _, _Args))
|
|
319
|
+
|
|
320
|
+
#define GMOCK_INTERNAL_GET_TYPE(_i, _, _elem) \
|
|
321
|
+
GMOCK_PP_COMMA_IF(_i) \
|
|
322
|
+
GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(_elem), GMOCK_PP_REMOVE_PARENS, \
|
|
323
|
+
GMOCK_PP_IDENTITY) \
|
|
324
|
+
(_elem)
|
|
325
|
+
|
|
326
|
+
#define GMOCK_INTERNAL_PARAMETER(_i, _Signature, _) \
|
|
327
|
+
GMOCK_PP_COMMA_IF(_i) \
|
|
328
|
+
GMOCK_INTERNAL_ARG_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature)) \
|
|
329
|
+
gmock_a##_i
|
|
330
|
+
|
|
331
|
+
#define GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _) \
|
|
332
|
+
GMOCK_PP_COMMA_IF(_i) \
|
|
333
|
+
::std::forward<GMOCK_INTERNAL_ARG_O( \
|
|
334
|
+
_i, GMOCK_PP_REMOVE_PARENS(_Signature))>(gmock_a##_i)
|
|
335
|
+
|
|
336
|
+
#define GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _) \
|
|
337
|
+
GMOCK_PP_COMMA_IF(_i) \
|
|
338
|
+
GMOCK_INTERNAL_MATCHER_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature)) \
|
|
339
|
+
gmock_a##_i
|
|
340
|
+
|
|
341
|
+
#define GMOCK_INTERNAL_MATCHER_ARGUMENT(_i, _1, _2) \
|
|
342
|
+
GMOCK_PP_COMMA_IF(_i) \
|
|
343
|
+
gmock_a##_i
|
|
344
|
+
|
|
345
|
+
#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _) \
|
|
346
|
+
GMOCK_PP_COMMA_IF(_i) \
|
|
347
|
+
::testing::A<GMOCK_INTERNAL_ARG_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature))>()
|
|
348
|
+
|
|
349
|
+
#define GMOCK_INTERNAL_ARG_O(_i, ...) \
|
|
350
|
+
typename ::testing::internal::Function<__VA_ARGS__>::template Arg<_i>::type
|
|
351
|
+
|
|
352
|
+
#define GMOCK_INTERNAL_MATCHER_O(_i, ...) \
|
|
353
|
+
const ::testing::Matcher<typename ::testing::internal::Function< \
|
|
354
|
+
__VA_ARGS__>::template Arg<_i>::type>&
|
|
355
|
+
|
|
356
|
+
#define MOCK_METHOD0(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 0, __VA_ARGS__)
|
|
357
|
+
#define MOCK_METHOD1(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 1, __VA_ARGS__)
|
|
358
|
+
#define MOCK_METHOD2(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 2, __VA_ARGS__)
|
|
359
|
+
#define MOCK_METHOD3(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 3, __VA_ARGS__)
|
|
360
|
+
#define MOCK_METHOD4(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 4, __VA_ARGS__)
|
|
361
|
+
#define MOCK_METHOD5(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 5, __VA_ARGS__)
|
|
362
|
+
#define MOCK_METHOD6(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 6, __VA_ARGS__)
|
|
363
|
+
#define MOCK_METHOD7(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 7, __VA_ARGS__)
|
|
364
|
+
#define MOCK_METHOD8(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 8, __VA_ARGS__)
|
|
365
|
+
#define MOCK_METHOD9(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 9, __VA_ARGS__)
|
|
366
|
+
#define MOCK_METHOD10(m, ...) \
|
|
367
|
+
GMOCK_INTERNAL_MOCK_METHODN(, , m, 10, __VA_ARGS__)
|
|
368
|
+
|
|
369
|
+
#define MOCK_CONST_METHOD0(m, ...) \
|
|
370
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 0, __VA_ARGS__)
|
|
371
|
+
#define MOCK_CONST_METHOD1(m, ...) \
|
|
372
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 1, __VA_ARGS__)
|
|
373
|
+
#define MOCK_CONST_METHOD2(m, ...) \
|
|
374
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 2, __VA_ARGS__)
|
|
375
|
+
#define MOCK_CONST_METHOD3(m, ...) \
|
|
376
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 3, __VA_ARGS__)
|
|
377
|
+
#define MOCK_CONST_METHOD4(m, ...) \
|
|
378
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 4, __VA_ARGS__)
|
|
379
|
+
#define MOCK_CONST_METHOD5(m, ...) \
|
|
380
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 5, __VA_ARGS__)
|
|
381
|
+
#define MOCK_CONST_METHOD6(m, ...) \
|
|
382
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 6, __VA_ARGS__)
|
|
383
|
+
#define MOCK_CONST_METHOD7(m, ...) \
|
|
384
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 7, __VA_ARGS__)
|
|
385
|
+
#define MOCK_CONST_METHOD8(m, ...) \
|
|
386
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 8, __VA_ARGS__)
|
|
387
|
+
#define MOCK_CONST_METHOD9(m, ...) \
|
|
388
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 9, __VA_ARGS__)
|
|
389
|
+
#define MOCK_CONST_METHOD10(m, ...) \
|
|
390
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, , m, 10, __VA_ARGS__)
|
|
391
|
+
|
|
392
|
+
#define MOCK_METHOD0_T(m, ...) MOCK_METHOD0(m, __VA_ARGS__)
|
|
393
|
+
#define MOCK_METHOD1_T(m, ...) MOCK_METHOD1(m, __VA_ARGS__)
|
|
394
|
+
#define MOCK_METHOD2_T(m, ...) MOCK_METHOD2(m, __VA_ARGS__)
|
|
395
|
+
#define MOCK_METHOD3_T(m, ...) MOCK_METHOD3(m, __VA_ARGS__)
|
|
396
|
+
#define MOCK_METHOD4_T(m, ...) MOCK_METHOD4(m, __VA_ARGS__)
|
|
397
|
+
#define MOCK_METHOD5_T(m, ...) MOCK_METHOD5(m, __VA_ARGS__)
|
|
398
|
+
#define MOCK_METHOD6_T(m, ...) MOCK_METHOD6(m, __VA_ARGS__)
|
|
399
|
+
#define MOCK_METHOD7_T(m, ...) MOCK_METHOD7(m, __VA_ARGS__)
|
|
400
|
+
#define MOCK_METHOD8_T(m, ...) MOCK_METHOD8(m, __VA_ARGS__)
|
|
401
|
+
#define MOCK_METHOD9_T(m, ...) MOCK_METHOD9(m, __VA_ARGS__)
|
|
402
|
+
#define MOCK_METHOD10_T(m, ...) MOCK_METHOD10(m, __VA_ARGS__)
|
|
403
|
+
|
|
404
|
+
#define MOCK_CONST_METHOD0_T(m, ...) MOCK_CONST_METHOD0(m, __VA_ARGS__)
|
|
405
|
+
#define MOCK_CONST_METHOD1_T(m, ...) MOCK_CONST_METHOD1(m, __VA_ARGS__)
|
|
406
|
+
#define MOCK_CONST_METHOD2_T(m, ...) MOCK_CONST_METHOD2(m, __VA_ARGS__)
|
|
407
|
+
#define MOCK_CONST_METHOD3_T(m, ...) MOCK_CONST_METHOD3(m, __VA_ARGS__)
|
|
408
|
+
#define MOCK_CONST_METHOD4_T(m, ...) MOCK_CONST_METHOD4(m, __VA_ARGS__)
|
|
409
|
+
#define MOCK_CONST_METHOD5_T(m, ...) MOCK_CONST_METHOD5(m, __VA_ARGS__)
|
|
410
|
+
#define MOCK_CONST_METHOD6_T(m, ...) MOCK_CONST_METHOD6(m, __VA_ARGS__)
|
|
411
|
+
#define MOCK_CONST_METHOD7_T(m, ...) MOCK_CONST_METHOD7(m, __VA_ARGS__)
|
|
412
|
+
#define MOCK_CONST_METHOD8_T(m, ...) MOCK_CONST_METHOD8(m, __VA_ARGS__)
|
|
413
|
+
#define MOCK_CONST_METHOD9_T(m, ...) MOCK_CONST_METHOD9(m, __VA_ARGS__)
|
|
414
|
+
#define MOCK_CONST_METHOD10_T(m, ...) MOCK_CONST_METHOD10(m, __VA_ARGS__)
|
|
415
|
+
|
|
416
|
+
#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
|
|
417
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 0, __VA_ARGS__)
|
|
418
|
+
#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
|
|
419
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 1, __VA_ARGS__)
|
|
420
|
+
#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
|
|
421
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 2, __VA_ARGS__)
|
|
422
|
+
#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
|
|
423
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 3, __VA_ARGS__)
|
|
424
|
+
#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
|
|
425
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 4, __VA_ARGS__)
|
|
426
|
+
#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
|
|
427
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 5, __VA_ARGS__)
|
|
428
|
+
#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
|
|
429
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 6, __VA_ARGS__)
|
|
430
|
+
#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
|
|
431
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 7, __VA_ARGS__)
|
|
432
|
+
#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
|
|
433
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 8, __VA_ARGS__)
|
|
434
|
+
#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
|
|
435
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 9, __VA_ARGS__)
|
|
436
|
+
#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
|
|
437
|
+
GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 10, __VA_ARGS__)
|
|
438
|
+
|
|
439
|
+
#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
|
|
440
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 0, __VA_ARGS__)
|
|
441
|
+
#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
|
|
442
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 1, __VA_ARGS__)
|
|
443
|
+
#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
|
|
444
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 2, __VA_ARGS__)
|
|
445
|
+
#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
|
|
446
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 3, __VA_ARGS__)
|
|
447
|
+
#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
|
|
448
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 4, __VA_ARGS__)
|
|
449
|
+
#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
|
|
450
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 5, __VA_ARGS__)
|
|
451
|
+
#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
|
|
452
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 6, __VA_ARGS__)
|
|
453
|
+
#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
|
|
454
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 7, __VA_ARGS__)
|
|
455
|
+
#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
|
|
456
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 8, __VA_ARGS__)
|
|
457
|
+
#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
|
|
458
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 9, __VA_ARGS__)
|
|
459
|
+
#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
|
|
460
|
+
GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 10, __VA_ARGS__)
|
|
461
|
+
|
|
462
|
+
#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
|
|
463
|
+
MOCK_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
464
|
+
#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
|
|
465
|
+
MOCK_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
466
|
+
#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
|
|
467
|
+
MOCK_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
468
|
+
#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
|
|
469
|
+
MOCK_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
470
|
+
#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
|
|
471
|
+
MOCK_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
472
|
+
#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
|
|
473
|
+
MOCK_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
474
|
+
#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
|
|
475
|
+
MOCK_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
476
|
+
#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
|
|
477
|
+
MOCK_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
478
|
+
#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
|
|
479
|
+
MOCK_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
480
|
+
#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
|
|
481
|
+
MOCK_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
482
|
+
#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
|
|
483
|
+
MOCK_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
484
|
+
|
|
485
|
+
#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
|
|
486
|
+
MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
487
|
+
#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
|
|
488
|
+
MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
489
|
+
#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
|
|
490
|
+
MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
491
|
+
#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
|
|
492
|
+
MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
493
|
+
#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
|
|
494
|
+
MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
495
|
+
#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
|
|
496
|
+
MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
497
|
+
#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
|
|
498
|
+
MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
499
|
+
#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
|
|
500
|
+
MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
501
|
+
#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
|
|
502
|
+
MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
503
|
+
#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
|
|
504
|
+
MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
505
|
+
#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
|
|
506
|
+
MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__)
|
|
507
|
+
|
|
508
|
+
#define GMOCK_INTERNAL_MOCK_METHODN(constness, ct, Method, args_num, ...) \
|
|
509
|
+
GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE( \
|
|
510
|
+
args_num, ::testing::internal::identity_t<__VA_ARGS__>); \
|
|
511
|
+
GMOCK_INTERNAL_MOCK_METHOD_IMPL( \
|
|
512
|
+
args_num, Method, GMOCK_PP_NARG0(constness), 0, 0, , ct, , \
|
|
513
|
+
(::testing::internal::identity_t<__VA_ARGS__>))
|
|
514
|
+
|
|
515
|
+
#define GMOCK_MOCKER_(arity, constness, Method) \
|
|
516
|
+
GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
|
|
517
|
+
|
|
518
|
+
#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_
|