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