1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729
|
/*
* Trompeloeil C++ mocking framework
*
* Copyright Björn Fahller 2014-2019
* Copyright (C) 2017, 2018 Andrew Paxie
*
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* Project home: https://github.com/rollbear/trompeloeil
*/
#ifndef COMPILING_TESTS_HPP_
#define COMPILING_TESTS_HPP_
#include <cstddef>
struct QCharIsh {
constexpr QCharIsh(int) noexcept;
};
constexpr bool operator==(std::nullptr_t,QCharIsh) noexcept;
constexpr bool operator==(QCharIsh,std::nullptr_t) noexcept;
#define TROMPELOEIL_SANITY_CHECKS
#include <trompeloeil.hpp>
#include <algorithm>
#include <cstddef>
#include <memory>
#include <regex>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#if defined(_MSC_VER)
#define TROMPELOEIL_TEST_REGEX_FAILURES 1
#define TROMPELOEIL_TEST_REGEX_BOL_EOL_FAILURES 1
#else /* defined(_MSC_VER) */
// Detect if using libstdc++.
#if defined(__GLIBCXX__)
// Using libstdc++.
#define TROMPELOEIL_USING_LIBSTDCPP 1
#else
#define TROMPELOEIL_USING_LIBSTDCPP 0
#endif
// Detect if using libc++
#if defined(_LIBCPP_VERSION)
// Using libc++
#define TROMPELOEIL_USING_LIBCPP 1
#define TROMPELOEIL_LIBCPP_VERSION _LIBCPP_VERSION
#else
#define TROMPELOEIL_USING_LIBCPP 0
#define TROMPELOEIL_LIBCPP_VERSION 0
#endif
/*
* The implementation of <regex> is not complete for libstdc++ in GCC 4.8.x.
* For this reason most tests with reporting will be disabled
* if compiling with libstdc++.
*/
#if !defined(TROMPELOEIL_TEST_REGEX_FAILURES)
#if TROMPELOEIL_USING_LIBSTDCPP && \
TROMPELOEIL_GCC && TROMPELOEIL_GCC_VERSION < 40900
#define TROMPELOEIL_TEST_REGEX_FAILURES 0
#else
#define TROMPELOEIL_TEST_REGEX_FAILURES 1
#endif
#endif /* !defined(TROMPELOEIL_TEST_REGEX_FAILURES) */
/*
* The implementation of <regex> in libc++ 1.1.1 (1101),
* used with Clang++ 3.5.x and Clang++ 3.6.x, is not complete for
* std::regex_constants::match_not_bol and
* std::regex_constants::match_not_eol.
*
* For this reason tests using these constants will be
* disabled when using this version of the library,
* or earlier.
*/
#if !defined(TROMPELOEIL_TEST_REGEX_BOL_EOL_FAILURES)
#if TROMPELOEIL_LIBCPP_VERSION > 1101
#define TROMPELOEIL_TEST_REGEX_BOL_EOL_FAILURES 1
#else
#define TROMPELOEIL_TEST_REGEX_BOL_EOL_FAILURES 0
#endif
#endif /* !defined(TROMPELOEIL_TEST_REGEX_BOL_EOL_FAILURES) */
#endif /* !defined(_MSC_VER) */
namespace detail
{
/*
* Use compiler-version independent make_unique.
*/
using ::trompeloeil::detail::make_unique;
// std::uncaught_exception() is deprecated in C++17.
inline
bool
there_are_uncaught_exceptions()
{
/*
* GCC 5.x supports specifying -std=c++17 but libstdc++-v3 for
* GCC 5.x doesn't declare std::uncaught_exceptions().
* Rather than detect what version of C++ Standard Library
* is in use, we equate the compiler version with the library version.
*
* Some day this test will based on __cpp_lib_uncaught_exceptions.
*/
# if (TROMPELOEIL_CPLUSPLUS > 201402L) && \
((!TROMPELOEIL_GCC) || \
(TROMPELOEIL_GCC && TROMPELOEIL_GCC_VERSION >= 60000))
return std::uncaught_exceptions() > 0;
# else
return std::uncaught_exception();
# endif
}
} /* namespace detail */
class reported {};
struct report
{
trompeloeil::severity s;
const char *file;
unsigned long line;
std::string msg;
};
extern std::vector<report> reports;
extern std::vector<std::string> okReports;
namespace trompeloeil
{
template <>
struct reporter<specialized>
{
static void send(severity s,
char const* file,
unsigned long line,
char const* msg)
{
reports.push_back(report{s, file, line, msg});
if (s == severity::fatal && !::detail::there_are_uncaught_exceptions())
{
throw reported{};
}
}
static void sendOk(char const* msg)
{
okReports.push_back(msg);
}
};
}
struct Fixture
{
Fixture() {
reports.clear();
okReports.clear();
}
};
struct not_default_constructible
{
not_default_constructible(int) {}
};
struct uncopyable
{
uncopyable() {}
uncopyable(uncopyable&&) = default;
uncopyable(const uncopyable&) = delete;
uncopyable& operator=(const uncopyable&) = delete;
bool operator==(const uncopyable& p) const { return &p == this; }
bool operator!=(const uncopyable& p) const { return &p == this; }
friend std::ostream& operator<<(std::ostream& os, const uncopyable& obj)
{
return os << "uncopyable@" << &obj;
}
};
struct unmovable
{
unmovable() {}
unmovable(unmovable&&) = delete;
unmovable(const unmovable&) = delete;
unmovable& operator=(unmovable&&) = delete;
unmovable& operator=(const unmovable&) = delete;
bool operator==(const unmovable& p) const { return &p == this; }
bool operator!=(const unmovable& p) const { return &p != this; }
friend std::ostream& operator<<(std::ostream& os, const unmovable& obj)
{
return os << "unmovable@" << &obj;
}
};
struct interface
{
virtual ~interface() = default;
virtual int func(int) = 0;
virtual int cfunc(int) const = 0;
virtual int func3(int, int, std::string) = 0;
virtual int func3(int, int, std::string) const = 0;
};
struct mi : trompeloeil::mock_interface<interface>
{
using mock_interface::mock_interface;
IMPLEMENT_MOCK1(func);
IMPLEMENT_CONST_MOCK1(cfunc);
IMPLEMENT_MOCK3(func3);
IMPLEMENT_CONST_MOCK3(func3, noexcept);
};
struct uncomparable { };
struct uncomparable_string {
uncomparable_string(const char* p) : s(p) {}
bool operator==(const uncomparable_string& rh) const noexcept
{
return s == rh.s;
}
bool operator==(const char*) const = delete;
friend
std::ostream& operator<<(std::ostream& os, const uncomparable_string& u)
{
return os << u.s;
}
std::string s;
};
class null_constructible {
public:
null_constructible(int* p_) : p(p_) {}
bool operator==(null_constructible rh) const { return *p == *rh.p; }
friend std::ostream& operator<<(std::ostream& os, const null_constructible&)
{
return os << "null_constructible";
}
private:
int* p;
};
struct null_comparable {
void* p;
bool operator==(std::nullptr_t) const noexcept { return !p; }
friend bool operator==(std::nullptr_t, null_comparable n) { return !n.p; }
friend std::ostream& operator<<(std::ostream& os, const null_comparable&)
{
return os << "null_comparable";
}
};
struct pseudo_null_comparable {
void operator==(std::nullptr_t) const {} // looking at you, boost::variant<>!
friend void operator==(std::nullptr_t, pseudo_null_comparable) {}
friend
std::ostream& operator<<(std::ostream& os, const pseudo_null_comparable&)
{
return os << "pseudo_null_comparable";
}
};
class C
{
public:
C() {}
C(int) {}
C(C&&) = default;
virtual ~C() = default;
virtual int count() = 0;
virtual void func(int, std::string& s) = 0;
virtual unmovable& getter(unmovable&) = 0;
virtual int getter(int) = 0;
virtual void getter(int, std::string&) = 0;
virtual std::unique_ptr<int> ptr(std::unique_ptr<int>&&) = 0;
protected:
C(const char* s) : p_{ s } {}
const char *p_ = nullptr;
};
class mock_c : public C
{
public:
mock_c() noexcept {}
mock_c(int i) : C(i) {}
mock_c(const char* p) noexcept : C(p) {}
MAKE_MOCK1(ptr, std::unique_ptr<int>(std::unique_ptr<int>&&), override);
MAKE_MOCK0(count, int(), override final);
MAKE_MOCK1(foo, void(std::string));
MAKE_MOCK2(func, void(int, std::string&), override);
MAKE_MOCK1(getter, unmovable&(unmovable&), override);
MAKE_MOCK1(getter, int(int), override);
MAKE_MOCK2(getter, void(int, std::string&), override);
MAKE_MOCK0(no_default_return, not_default_constructible());
using C::p_;
};
class movable_mock
{
public:
movable_mock() = default;
static constexpr bool trompeloeil_movable_mock = true;
MAKE_MOCK1(func, void(int));
};
int intfunc(int i);
extern int global_n;
struct mstr
{
MAKE_MOCK0(cc_str, const char*());
MAKE_MOCK0(c_str, char*());
MAKE_MOCK0(str, std::string());
MAKE_MOCK0(cstr, const std::string());
};
extern char carr[4]; // silence clang++ warning
const char ccarr[] = "bar";
class U
{
public:
using mptr_f = void (U::*)(const char*);
using mptr_d = int U::*;
MAKE_MOCK1(func_streamref, void(std::ostream&));
MAKE_MOCK1(func_u, void(const uncomparable&));
MAKE_MOCK1(func_v, void(int));
MAKE_MOCK1(func_cv, void(const int));
MAKE_MOCK1(func_lr, void(int&));
MAKE_MOCK1(func_clr, void(const int&));
MAKE_MOCK1(func_rr, void(int&&));
MAKE_MOCK1(func_crr, void(const int&&));
MAKE_MOCK1(func_uniqv, void(std::unique_ptr<int>));
MAKE_MOCK1(func_sharedv, void(std::shared_ptr<int>));
MAKE_MOCK1(func, void(int&));
MAKE_MOCK1(func, void(const int&));
MAKE_MOCK1(func, void(int&&));
MAKE_MOCK1(func_cstr, void(const char*));
MAKE_MOCK1(func_ptr_f, void(int (*)(int)));
MAKE_MOCK1(func_mptr_f, void(mptr_f));
MAKE_MOCK1(func_mptr_d, void(mptr_d));
MAKE_MOCK1(func_ustr, void(const uncomparable_string&));
MAKE_MOCK1(func_ustrv, void(uncomparable_string));
MAKE_MOCK1(func_f, void(std::function<void()>));
MAKE_MOCK1(func_tupv, void(std::tuple<int>));
MAKE_MOCK1(func_tupr, void(std::tuple<int>&));
MAKE_MOCK1(func_tuprr, void(std::tuple<int>&&));
MAKE_MOCK1(func_tupcr, void(const std::tuple<int>&));
MAKE_MOCK1(func_tupcrr, void(const std::tuple<int>&&x));
int m;
};
struct C_foo1
{
MAKE_MOCK1(foo, void(int*));
};
struct C_foo2
{
MAKE_MOCK1(foo, void(int*));
MAKE_MOCK1(foo, void(char*));
};
struct C_foo3
{
int m;
MAKE_MOCK1(foo, void(int C_foo3::*));
MAKE_MOCK1(bar, void(int (*)(int)));
};
class mock_str
{
public:
MAKE_MOCK1(c_c_str, void(char const*));
MAKE_MOCK1(c_str, void(char*));
MAKE_MOCK1(strcref, void(std::string const&));
MAKE_MOCK1(strref, void(std::string&));
MAKE_MOCK1(strrref, void(std::string&&));
MAKE_MOCK1(str, void(std::string));
MAKE_MOCK1(overload, void(char const*));
MAKE_MOCK1(overload, void(std::string const&));
};
class C_ptr
{
public:
MAKE_MOCK1(ptr, void(int*));
MAKE_MOCK1(uptr, void(std::unique_ptr<int>));
MAKE_MOCK1(uptrrr, void(std::unique_ptr<int>&&));
MAKE_MOCK1(uptrcr, void(std::unique_ptr<int> const&));
MAKE_MOCK1(uptrr, void(std::unique_ptr<int>&));
MAKE_MOCK1(strptr, void(std::string*));
MAKE_MOCK1(pp, void(int**));
MAKE_MOCK1(overloaded, void(int**));
MAKE_MOCK1(overloaded, void(std::string*));
MAKE_MOCK1(coverload, void(int*));
MAKE_MOCK1(coverload, void(const int*));
};
template <typename T>
class any_of_t : public trompeloeil::typed_matcher<T>
{
public:
any_of_t(std::initializer_list<T> elements) : alternatives(std::begin(elements), std::end(elements)) {}
bool matches(T const& t) const
{
return std::any_of(std::begin(alternatives), std::end(alternatives),
[&](T val) { return t == val; });
}
friend std::ostream& operator<<(std::ostream& os, any_of_t<T> const& t)
{
os << " matching any_of({";
char const* prefix = " ";
for (auto& n : t.alternatives)
{
os << prefix << n;
prefix = ", ";
}
return os << " })";
}
private:
std::vector<T> alternatives;
};
template <typename T>
inline
auto
any_of(std::initializer_list<T> elements)
-> decltype(any_of_t<T>(elements))
{
return any_of_t<T>(elements);
}
template <typename T>
class has_empty
{
protected:
struct no;
static no func(...);
template <typename U>
static auto func(U const* u) -> decltype(u->empty());
public:
static const bool value = !std::is_same<no, decltype(func(std::declval<T*>()))>::value;
};
class not_empty : public trompeloeil::matcher
{
public:
template <typename T, typename = typename std::enable_if<has_empty<T>::value>::type>
operator T() const;
template <typename T>
bool matches(T const& t) const
noexcept(noexcept(!t.empty()))
{
return !t.empty();
}
friend std::ostream& operator<<(std::ostream& os, not_empty const&)
{
return os << " is not empty";
}
};
struct unknown {
const char values[4] = { 0x01, 0x02, 0x12, 0x13 };
};
namespace nn
{
struct TestOutput;
inline void print(std::ostream&, const TestOutput&);
struct TestOutput
{
int n;
};
void
print(std::ostream& os, const TestOutput& p)
{
os << "nn::print(TestOutput{" << p.n << "}";
}
template <typename T>
struct wrapped
{
T value;
friend std::ostream& operator<<(std::ostream& os, const wrapped<T>& w)
{
return os << "wrapped(" << w.value << ')';
}
};
} // namespace nn
namespace trompeloeil
{
template <>
inline void print(std::ostream& os, const nn::TestOutput& p)
{
os << "trompeloeil::print(nn::TestOutput{" << p.n << "})";
}
} // namespace trompeloeil
struct my_printable
{
int x;
};
class TestOutputMock
{
public:
MAKE_MOCK1(func, void(nn::TestOutput));
MAKE_MOCK1(func, void(nn::wrapped<int>));
MAKE_MOCK1(func, void(my_printable));
};
class none
{
public:
none() noexcept {}
none(none const&) noexcept {}
virtual ~none() {}
};
class T
{
public:
MAKE_MOCK15(concats, std::string(int, int, int, int,
int, int, int, int,
int, int, int, int,
int, int, int));
MAKE_MOCK1(ptr, void(std::shared_ptr<int>));
MAKE_MOCK1(ptr, void(std::unique_ptr<int>));
};
template <int N>
struct I
{
I(int i_) : i{i_} {}
operator int() const noexcept { return i; }
int i;
};
struct all_if
{
virtual ~all_if() = default;
virtual void f0() = 0;
virtual void f1(I<1>) = 0;
virtual void f2(I<1>, I<2>) = 0;
virtual void f3(I<1>, I<2>, I<3>) = 0;
virtual void f4(I<1>, I<2>, I<3>, I<4>) = 0;
virtual void f5(I<1>, I<2>, I<3>, I<4>, I<5>) = 0;
virtual void f6(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>) = 0;
virtual void f7(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>) = 0;
virtual void f8(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>) = 0;
virtual void f9(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>) = 0;
virtual void f10(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>) = 0;
virtual void f11(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>) = 0;
virtual void f12(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>) = 0;
virtual void f13(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>) = 0;
virtual void f14(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>) = 0;
virtual void f15(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>,I<15>) = 0;
virtual void cf0() const = 0;
virtual void cf1(I<1>) const = 0;
virtual void cf2(I<1>, I<2>) const = 0;
virtual void cf3(I<1>, I<2>, I<3>) const = 0;
virtual void cf4(I<1>, I<2>, I<3>, I<4>) const = 0;
virtual void cf5(I<1>, I<2>, I<3>, I<4>, I<5>) const = 0;
virtual void cf6(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>) const = 0;
virtual void cf7(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>) const = 0;
virtual void cf8(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>) const = 0;
virtual void cf9(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>) const = 0;
virtual void cf10(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>) const= 0;
virtual void cf11(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>) const = 0;
virtual void cf12(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>) const = 0;
virtual void cf13(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>) const = 0;
virtual void cf14(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>) const = 0;
virtual void cf15(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>,I<15>) const = 0;
virtual std::tuple<int, float, double> f1t(I<1>) = 0;
virtual std::pair<int, float> cf1t(I<1>) const = 0;
};
struct all_mock_if : public all_if
{
MAKE_MOCK0(f0, void(), override);
MAKE_MOCK1(f1, void(I<1>), override);
MAKE_MOCK2(f2, void(I<1>, I<2>), override);
MAKE_MOCK3(f3, void(I<1>, I<2>, I<3>), override);
MAKE_MOCK4(f4, void(I<1>, I<2>, I<3>, I<4>), override);
MAKE_MOCK5(f5, void(I<1>, I<2>, I<3>, I<4>, I<5>), override);
MAKE_MOCK6(f6, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>), override);
MAKE_MOCK7(f7, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>), override);
MAKE_MOCK8(f8, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>), override);
MAKE_MOCK9(f9, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>), override);
MAKE_MOCK10(f10, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>), override);
MAKE_MOCK11(f11, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>), override);
MAKE_MOCK12(f12, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>), override);
MAKE_MOCK13(f13, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>), override);
MAKE_MOCK14(f14, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>), override);
MAKE_MOCK15(f15, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>,I<15>), override);
MAKE_CONST_MOCK0(cf0, void(), override);
MAKE_CONST_MOCK1(cf1, void(I<1>), override);
MAKE_CONST_MOCK2(cf2, void(I<1>, I<2>), override);
MAKE_CONST_MOCK3(cf3, void(I<1>, I<2>, I<3>), override);
MAKE_CONST_MOCK4(cf4, void(I<1>, I<2>, I<3>, I<4>), override);
MAKE_CONST_MOCK5(cf5, void(I<1>, I<2>, I<3>, I<4>, I<5>), override);
MAKE_CONST_MOCK6(cf6, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>), override);
MAKE_CONST_MOCK7(cf7, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>), override);
MAKE_CONST_MOCK8(cf8, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>), override);
MAKE_CONST_MOCK9(cf9, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>), override);
MAKE_CONST_MOCK10(cf10, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>), override);
MAKE_CONST_MOCK11(cf11, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>), override);
MAKE_CONST_MOCK12(cf12, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>), override);
MAKE_CONST_MOCK13(cf13, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>), override);
MAKE_CONST_MOCK14(cf14, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>), override);
MAKE_CONST_MOCK15(cf15, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>,I<15>), override);
MAKE_MOCK1(f1t, (std::tuple<int, float, double>(I<1>)), override);
MAKE_CONST_MOCK1(cf1t, (std::pair<int, float>(I<1>)), override);
};
struct all_mock
{
MAKE_MOCK0(f0, void());
MAKE_MOCK1(f1, void(I<1>));
MAKE_MOCK2(f2, void(I<1>, I<2>));
MAKE_MOCK3(f3, void(I<1>, I<2>, I<3>));
MAKE_MOCK4(f4, void(I<1>, I<2>, I<3>, I<4>));
MAKE_MOCK5(f5, void(I<1>, I<2>, I<3>, I<4>, I<5>));
MAKE_MOCK6(f6, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>));
MAKE_MOCK7(f7, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>));
MAKE_MOCK8(f8, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>));
MAKE_MOCK9(f9, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>));
MAKE_MOCK10(f10, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>));
MAKE_MOCK11(f11, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>));
MAKE_MOCK12(f12, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>));
MAKE_MOCK13(f13, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>));
MAKE_MOCK14(f14, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>));
MAKE_MOCK15(f15, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>,I<15>));
MAKE_CONST_MOCK0(cf0, void());
MAKE_CONST_MOCK1(cf1, void(I<1>));
MAKE_CONST_MOCK2(cf2, void(I<1>, I<2>));
MAKE_CONST_MOCK3(cf3, void(I<1>, I<2>, I<3>));
MAKE_CONST_MOCK4(cf4, void(I<1>, I<2>, I<3>, I<4>));
MAKE_CONST_MOCK5(cf5, void(I<1>, I<2>, I<3>, I<4>, I<5>));
MAKE_CONST_MOCK6(cf6, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>));
MAKE_CONST_MOCK7(cf7, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>));
MAKE_CONST_MOCK8(cf8, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>));
MAKE_CONST_MOCK9(cf9, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>));
MAKE_CONST_MOCK10(cf10, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>));
MAKE_CONST_MOCK11(cf11, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>));
MAKE_CONST_MOCK12(cf12, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>));
MAKE_CONST_MOCK13(cf13, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>));
MAKE_CONST_MOCK14(cf14, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>));
MAKE_CONST_MOCK15(cf15, void(I<1>, I<2>, I<3>, I<4>, I<5>, I<6>, I<7>, I<8>,
I<9>,I<10>,I<11>,I<12>,I<13>,I<14>,I<15>));
MAKE_MOCK1(f1t, (std::tuple<int, float, double>(I<1>)));
MAKE_CONST_MOCK1(cf1t, (std::pair<int, float>(I<1>)));
};
#endif /* !COMPILING_TESTS_HPP_ */
|