Commit graph

14 commits

Author SHA1 Message Date
Alexander Grund
f191de5a5a
Add test for serializing a string or functor matcher 2023-01-07 12:06:44 +01:00
Alexander Grund
6fecabcad5
Bring back the fixture
Without using a `std::string` the compiler may put the `const char*` C-Strings to the same memory address so our test might succeed when it should not.
Add a short descriptive comment and check the property where it is used.
2023-01-03 18:55:46 +01:00
Alexander Grund
700ceb9f4d
Remove fixture of tests in test_matcher
The fixture is not really required and can be replaced by definitions in
each test which even improves readability.
Also the tests are partially redundant due to implicit conversions so
add test in test_function for actual usage testing of string comparisons.
2023-01-03 18:55:45 +01:00
Alex Smith
e55342385e Review corrections
Corrected stylistic mistakes and simplified a couple of the new tests.
2023-01-03 16:28:27 +00:00
Alex Smith
528761b180 Unit test nullptr C-style strings
Added unit tests for the cases of matching and serializing C-style strings (char*) that are nullptr.

(As of this revision, these new tests correctly fail, except for the test of mock::equal; fix to follow.)
2023-01-02 17:30:54 +00:00
Alexander Grund
fca30e7780
Replace Boost PP_Iterate by C++11 variadic templates
This allows support for any number of arguments and makes setting MOCK_MAX_ARGS unnecessary.
It also allows for easier debugging due to being able to step into actual code instead of preprocessor generated stuff
2022-02-10 17:46:00 +01:00
Alexander Grund
1a81536f3c
Improve tests
- Check callability of function.expect.with(...)
- Check serialization of MOCK_CONSTRAINT
- Actually test some variations of MOCK_CONSTRAINT usages
- Add more test for unique_ptr (move-only class)
- Remove redundant stuff from test_log and change a few values to catch mistakes
- Add test for *-matcher serialization
2022-02-09 15:45:31 +01:00
Alexander Grund
ee72e8b9d8
Format code using Clang-Format 10 and enforce via CI
Makes the format of the code base uniform.
2022-01-24 16:30:59 +01:00
Alexander Grund
c2617ba360
Update from deprecated unit test header inclusion 2022-01-07 17:08:14 +01:00
Alexander Grund
35e43d58a6
Use std::reference_wrapper instead of boost 2022-01-07 17:08:12 +01:00
Mathieu Champlon
c950c24f52 Changed layout to match boost 2015-03-06 06:41:12 +01:00
mat007
02468ee43a Added multi-constraint
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@772 860be788-9bd5-4423-9f1e-828f051e677b
2015-03-01 11:29:03 +00:00
mat007
6558254c50 Fixed boost::cref invalid for temporary objects
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@759 860be788-9bd5-4423-9f1e-828f051e677b
2014-11-23 10:54:14 +00:00
mat007
a84c66c714 Renamed mock::detail::check to mock::matcher
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@567 860be788-9bd5-4423-9f1e-828f051e677b
2012-09-21 22:19:52 +00:00
Renamed from test/detail/test_check.cpp (Browse further)