Commit Graph

6 Commits (4c94d78f1b07b96c0015968583196be65eb73159)

Author SHA1 Message Date
Martin Kojtal e52bb68f93 tests: astyle fix
All tests should comply to our coding standard now
2018-08-03 10:23:38 +01:00
Christopher Haster 4cad764162 Added copyright header to all tests 2017-08-07 12:02:33 -05:00
Christopher Haster 9c0c95a24b callback - Added tests for inheritance and implicit casts 2016-11-09 14:00:15 -06:00
Christopher Haster c18e1786cd callback - Updated tests based on argument order 2016-09-29 16:55:49 -05:00
Christopher Haster 756a09003c Added explicit void specialization in callbacks
One limitation of C++ is that implicit casts do not occur when
matching template overloads, as a consequence the callback's
argument type requires a strict match.

Unfortunately, the prevents the previously common pattern of using
void pointers as function arguments, causing unnecessary problems
for users porting code.

        Thing *t;
        void doit(void *p) { blablabla }

        Callback<void()> cb(t, doit);

To avoid this, explicit overloads on void pointers were added. This
avoids a template expansion, and allows the implicit cast to occur
as the user would expect.
2016-08-26 12:50:13 -05:00
Christopher Haster 5c0f39f190 Split callback test into multiple tests based on types
As the templated tests grew, the resulting binary exceeded a
flash size of 64K. This caused the test to incorrectly fail on
small devices.

Moved and split into the following:
TESTS/mbed_functional/callback
TESTS/mbed_functional/callback_small
TESTS/mbed_functional/callback_big
TESTS/mbed_functional/functionpointer
2016-08-26 09:54:13 -05:00