[PATCH 0/3] Test static functions

Artsiom Anikeyenka arty.anikey at gmail.com
Wed Dec 11 05:02:27 PST 2013


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 <mchqwerty at gmail.com> 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
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20131211/e9345531/attachment.html>


More information about the wayland-devel mailing list