Skip to content

Releases: eranpeer/FakeIt

2.5.0

14 Nov 13:28

Choose a tag to compare

  • Added (Always)ReturnValCapt that forces the capture of its parameter by value (even if the function returns a reference) and (Always)ReturnRefCapt that forces the capture of its parameter by reference (even if the function returns a value). #280 #332 #356
    • DEPRECATION NOTICE: Previously, to replicate this functionality, some people used to provide explicit template parameters to Return functions, like .Return<std::string>(str) for a function returning const std::string&. Now ReturnValCapt can be used instead, it is more explicit and safer, all usages of the previous (undocumented / unsupported) hack should be replaced by the new syntax. Same goes for .Return<std::string&>(str) that can now be replaced by ReturnRefCapt.
    • (potentially) BREAKING: Disabled (Always)Return taking an rvalue-reference for functions returning a reference. Most often than not, this was the cause of dangling references. Now it prints a nice error message suggesting to use a safe alternative ((Always)ReturnValCapt).
  • Made fakeit::Mock objects move-constructible (and disabled the copy-constructor). #334
  • Now objects passed by rvalue-reference to .Return() will be moved, even if they are copyable (i.e. std::move is respected). Before that, objects that were copyable were always copied, independent of how they were passed. #330
  • Fixed a compile error on Clang 19. #350
  • Fixed some warnings in the library. #322 #355 #358
  • Added a macOS runner that tests the library with AppleClang in the CI. Also added a 64 bits MSVC job, but without RTTI-dependent tests, because RTTI-related features of FakeIt aren't supported in MSVC 64 bits. Plus some CI improvements. #319 #321 #333 #335 #352
  • Added a tool to help create compilation speed benchmarks. #338
  • Fixed some warnings in the tests. #329

2.4.1

06 Oct 18:57

Choose a tag to compare

  • Fixed an incompatibility with recent versions of Catch2. #345

2.4.0

17 Apr 20:33

Choose a tag to compare

  • Changed the build system to CMake, added the necessary code to install the library with CMake. For more information, check the README. #192 #311 #315
  • Added mocking of reference-qualified overloads through RefOverloadedMethod, ConstRefOverloadedMethod, RValRefOverloadedMethod, ConstRValRefOverloadedMethod. #293 #309 #316
  • Fixed mocking of destructors in MSVC. #312
  • Fixed Spy() in MSVC. #312
  • Fixed detection of the C++ standard in MSVC. #317
  • Improved support of UndefinedBehaviorSanitizer / AddressSanitizer, the library should now be usable with these sanitizers enabled. #261 #318
  • Added more installation instructions in the README. #291 #314
  • Improved the CI to test the library with a lot more configurations. #313

2.3.2

16 Dec 12:55

Choose a tag to compare

  • Fixed an incompatibility with C++23 causing a compilation error #303

2.3.1

02 Dec 14:28

Choose a tag to compare

  • Automatically fake the destructor of mocks on MSVC, you no longer need to do it yourself. The behavior is now the same as for Clang / GCC #289
  • Allow stubbing of functions with move-only return values #282
  • Extended lifetime of mock actions to fix some rare segfaults #301
  • Fixed a compilation error when trying to mock functions taking a vector of move-only objects #298
  • Fixed a compilation error when using ReturnAndSet for a type convertible but not assignable to the type of the parameter #295
  • Fixed name collision with macro for some template parameters #300
  • Fixed some compilation issues on MSVC #290
  • Fixed a rare compilation error #299

2.3.0

12 Jun 08:37

Choose a tag to compare

  • Added doctest integration #275
  • Fixed some error when using AnyMatcher argument matcher (_) with types that have constructors that take anything (for example, Eigen::Vector2f) #276
  • Improved support of older version of GCC #277

2.2.0

22 May 17:36

Choose a tag to compare

  • BREAKING: Changed Spy() method to copy arguments instead of moving them. The goal is to be able to keep the value so they can be Verify()ed later. To forward them instead (for move-only types), you can use SpyWithoutVerify(), but then you won't be able to use Verify() on these methods #272
  • Added an ApproxEq() matcher, that match numeric values with some margin #271
  • Rewrote matcher code to be able to store a different type than the type that is checked, and to perfect-forward the value stored instead of always copying it. Fix object slicing and matching move-only types #268
  • Fixed mocking for some kind of functions (templated overloaded methods) #267

2.1.1

01 May 13:18

Choose a tag to compare

  • Fix ReturnAndSet() compile error when using incompatible argument types #266

2.1.0

13 Mar 09:30

Choose a tag to compare

  • Add ReturnAndSet() & AlwaysReturnAndSet() functions to assign output args #215
  • Add Any verification specifier #247
  • Added StrEq matcher and derivatives #256
  • Add detection and support for Catch2 v3 #263
  • Improve support for older versions of catch2
  • Fix warnings for GCC v11.1 and Clang v11.1 #246

2.0.9

12 May 12:01

Choose a tag to compare

  • Fix "unknown option" warning for GCC 7 and earlier.