test: define peck_unrefp in the header file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-03-03 10:57:01 +10:00
parent b6f477fb96
commit 19ae05b33b
6 changed files with 3 additions and 8 deletions

View file

@ -120,7 +120,7 @@ peck_destroy(struct peck *peck)
static
OBJECT_IMPLEMENT_CREATE(peck);
OBJECT_IMPLEMENT_UNREF_CLEANUP(peck);
OBJECT_IMPLEMENT_UNREF(peck);
OBJECT_IMPLEMENT_GETTER(peck, ei, struct ei*);
OBJECT_IMPLEMENT_GETTER(peck, eis, struct eis*);

View file

@ -281,6 +281,8 @@ peck_ei_event_type_name(enum ei_event_type type);
const char *
peck_eis_event_type_name(enum eis_event_type type);
DEFINE_UNREF_CLEANUP_FUNC(peck);
/* Define a bunch of _cleanup_foo_ macros for a struct foo */
DEFINE_UNREF_CLEANUP_FUNC(ei);
DEFINE_UNREF_CLEANUP_FUNC(ei_event);

View file

@ -34,7 +34,6 @@
#include "eierpecken.h"
DEFINE_UNREF_CLEANUP_FUNC(peck);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct memfile *, memfile_unref);
#define _cleanup_memfile_ _cleanup_(memfile_unrefp)

View file

@ -27,8 +27,6 @@
#include "util-munit.h"
#include "eierpecken.h"
DEFINE_UNREF_CLEANUP_FUNC(peck);
MUNIT_TEST(test_ei_seat_bind_unbind)
{
_unref_(peck) *peck = peck_new();

View file

@ -31,8 +31,6 @@
#include "util-strings.h"
#include "eierpecken.h"
DEFINE_UNREF_CLEANUP_FUNC(peck);
MUNIT_TEST(test_ei_ref_unref)
{
struct ei *ei = ei_new(NULL);

View file

@ -28,8 +28,6 @@
#include "eierpecken.h"
DEFINE_UNREF_CLEANUP_FUNC(peck);
MUNIT_TEST(eistest_ref_unref)
{
struct eis *eis = eis_new(NULL);