File: framework.h

package info (click to toggle)
libepc 0.4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 3,420 kB
  • sloc: ansic: 8,574; sh: 4,257; makefile: 253
file content (73 lines) | stat: -rw-r--r-- 2,972 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* Easy Publish and Consume Library
 * Copyright (C) 2007, 2008  Openismus GmbH
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Authors:
 *      Mathias Hasselmann
 */
#ifndef __EPC_TEST_FRAMEWORK_H__
#define __EPC_TEST_FRAMEWORK_H__

#include <avahi-client/lookup.h>
#include <glib.h>

G_BEGIN_DECLS

#define epc_test_pass_many(mask) \
  (_epc_test_pass (G_STRLOC, FALSE, (mask)))
#define epc_test_pass_once(mask) \
  (_epc_test_pass (G_STRLOC, TRUE, (mask)))
#define epc_test_pass_once_per_iface(mask, ifidx) \
  (_epc_test_pass_once_per_iface (G_STRLOC, (mask), (ifidx), FALSE))
#define epc_test_pass_once_for_each_iface(mask) \
  (_epc_test_pass_once_per_iface (G_STRLOC, (mask), 0, TRUE))
#define epc_test_quit() \
  (_epc_test_quit (G_STRLOC))

#define epc_test_goto_if_fail(Test, Label) G_STMT_START{        \
  if (!(Test))                                                  \
    {                                                           \
      g_warning ("%s: Assertion failed: %s", G_STRLOC, #Test);  \
      goto Label;                                               \
    }                                                           \
}G_STMT_END

enum
{
  EPC_TEST_MASK_INIT = 128,
  EPC_TEST_MASK_USER = 127,
  EPC_TEST_MASK_ALL  = 255
};

gboolean epc_test_init                 (gint                         tests);
gboolean epc_test_init_service_browser (const gchar                 *service,
                                        AvahiServiceBrowserCallback  callback,
                                        gpointer                     data);
gint     epc_test_run                  (void);
gint    _epc_test_quit                 (const gchar                 *strloc);

void    _epc_test_pass                 (const gchar                 *strloc,
                                        gboolean                     once,
                                        gint                         mask);

void    _epc_test_pass_once_per_iface  (const gchar                 *strloc,
                                        gint                         mask,
                                        guint                        ifidx,
                                        gboolean                     any);

G_END_DECLS

#endif /* __EPC_TEST_FRAMEWORK_H__ */