trompeloeil

FORK: Header only C++14 mocking framework
git clone https://git.neptards.moe/u3shit/trompeloeil.git
Log | Files | Refs | README

address_of_illegal_argument.cpp (752B)


      1 /*
      2  * Trompeloeil C++ mocking framework
      3  *
      4  * Copyright Björn Fahller 2016,2017
      5  *
      6  *  Use, modification and distribution is subject to the
      7  *  Boost Software License, Version 1.0. (See accompanying
      8  *  file LICENSE_1_0.txt or copy at
      9  *  http://www.boost.org/LICENSE_1_0.txt)
     10  *
     11  * Project home: https://github.com/rollbear/trompeloeil
     12  */
     13 
     14 //illegal argument
     15 
     16 #include <trompeloeil.hpp>
     17 
     18 struct MS
     19 {
     20   MAKE_MOCK1(f, void(int));
     21 };
     22 
     23 void func(const void*);
     24 
     25 int main()
     26 {
     27   MS obj;
     28 
     29 #if (TROMPELOEIL_CPLUSPLUS == 201103L)
     30 
     31   REQUIRE_CALL_V(obj, f(ANY(int)),
     32     .SIDE_EFFECT(func(&_2)));
     33 
     34 #else /* (TROMPELOEIL_CPLUSPLUS == 201103L) */
     35 
     36   REQUIRE_CALL(obj, f(ANY(int)))
     37     .SIDE_EFFECT(func(&_2));
     38 
     39 #endif /* !(TROMPELOEIL_CPLUSPLUS == 201103L) */
     40 }