times_0_after_throw.cpp (731B)
1 /* 2 * Trompeloeil C++ mocking framework 3 * 4 * Copyright Björn Fahller 2015,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 //THROW and TIMES\(0\) does not make sense 15 16 #include <trompeloeil.hpp> 17 18 struct MS 19 { 20 MAKE_MOCK0(f, int()); 21 }; 22 23 int main() 24 { 25 MS obj; 26 27 #if (TROMPELOEIL_CPLUSPLUS == 201103L) 28 29 REQUIRE_CALL_V(obj, f(), 30 .THROW(0) 31 .TIMES(0)); 32 33 #else /* (TROMPELOEIL_CPLUSPLUS == 201103L) */ 34 35 REQUIRE_CALL(obj, f()) 36 .THROW(0) 37 .TIMES(0); 38 39 #endif /* !(TROMPELOEIL_CPLUSPLUS == 201103L) */ 40 }