Releases: eranpeer/FakeIt
Releases · eranpeer/FakeIt
2.5.0
- Added
(Always)ReturnValCaptthat forces the capture of its parameter by value (even if the function returns a reference) and(Always)ReturnRefCaptthat 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
Returnfunctions, like.Return<std::string>(str)for a function returningconst std::string&. NowReturnValCaptcan 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 byReturnRefCapt. - (potentially) BREAKING: Disabled
(Always)Returntaking 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).
- DEPRECATION NOTICE: Previously, to replicate this functionality, some people used to provide explicit template parameters to
- Made
fakeit::Mockobjects 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::moveis 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
2.4.0
- 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
2.3.1
- 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
ReturnAndSetfor 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
2.2.0
- BREAKING: Changed
Spy()method to copy arguments instead of moving them. The goal is to be able to keep the value so they can beVerify()ed later. To forward them instead (for move-only types), you can useSpyWithoutVerify(), but then you won't be able to useVerify()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