Another neat option would be to include blah_blah.c files (with static function definitions u want to test) into blah_blah-test.c files. I like this solution more than macro redefinitions as it's simpler and lets you call actually static functions which makes testing stricter (just a little bit :)
Have a good day! On Thu, Dec 5, 2013 at 6:38 PM, Marek Ch <[email protected]> wrote: > Hi, > > I did similar thing like is in Weston for testing static functions. Also, > I wrote > few wl_buffer unit tests. > I appreaciate any comments :) > > P. S.: based on mailing here: > > http://lists.freedesktop.org/archives/wayland-devel/2013-November/012299.html > > > Thanks, > Marek Ch > > > Marek Ch (3): > wayland-private: add define for testing static functions > wayland-private: move struct wl_buffer into wayland-private.h > tests: add tests for wl_buffer_* > > src/connection.c | 18 +--- > src/wayland-private.h | 24 +++++ > tests/Makefile.am | 12 ++- > tests/buffer-test.c | 247 > ++++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 286 insertions(+), 15 deletions(-) > create mode 100644 tests/buffer-test.c > > -- > 1.8.4.2 > > _______________________________________________ > wayland-devel mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/wayland-devel >
_______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
