]> git.0d.be Git - empathy.git/blob - tests/check-helpers.h
Fix includes
[empathy.git] / tests / check-helpers.h
1 /*
2  * check-helpers.c - Source for some check helpers
3  * Copyright (C) 2007 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 #ifndef __CHECK_HELPERS_H__
20 #define __CHECK_HELPERS_H__
21
22 #include <glib.h>
23 #include <check.h>
24
25 void
26 check_helpers_init (void);
27
28 void
29 expect_critical (gboolean expected);
30
31 gboolean
32 got_critical (void);
33
34 #define fail_unless_critical(expr, ...)                          \
35 G_STMT_START {                                                    \
36   expect_critical (TRUE);                                         \
37   expr;                                                           \
38   _fail_unless (got_critical (), __FILE__, __LINE__,              \
39       "Expected g_critical, got none", ## __VA_ARGS__, NULL);     \
40   expect_critical (FALSE);                                        \
41 } G_STMT_END;
42
43 #endif /* #ifndef __CHECK_HELPERS_H__ */