2009-27-09 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / tests / cspi / classy-test-suite.h
1 /* 
2  * Classy Test - Terrible framework for testing asyncronous interface
3  *
4  * Copyright (C) 2008 Codethink Ltd
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 #ifndef CLASSY_TEST_SUITE_H
22 #define CLASSY_TEST_SUITE_H
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 GType classy_test_suite_get_type(void);
29
30 #define TYPE_CLASSY_TEST_SUITE (classy_test_suite_get_type())
31
32 #define CLASSY_TEST_SUITE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),       \
33                                 TYPE_CLASSY_TEST_SUITE,                 \
34                                 ClassyTestSuite))
35
36 #define CLASSY_TEST_SUITE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),    \
37                                             TYPE_CLASSY_TEST_SUITE,             \
38                                             ClassyTestSuiteClass))
39
40 #define IS_CLASSY_TEST_SUITE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),   \
41                                             TYPE_CLASSY_TEST_SUITE))
42
43 #define IS_CLASSY_TEST_SUITE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),    \
44                                             TYPE_CLASSY_TEST_SUITE))
45
46 #define CLASSY_TEST_SUITE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),    \
47                                             TYPE_CLASSY_TEST_SUITE,             \
48                                             ClassyTestSuiteClass))
49
50 typedef struct _ClassyTestSuite ClassyTestSuite;
51 typedef struct _ClassyTestSuiteClass ClassyTestSuiteClass;
52
53 struct _ClassyTestSuite {
54         ClassyTest parent;
55
56         GArray *cases;
57         gint current;
58         gboolean cont;
59
60         gpointer data;
61 };
62
63 struct _ClassyTestSuiteClass {
64         ClassyTestClass parent;
65 };
66
67 ClassyTestSuite *
68 classy_test_suite_new(gchar *name, gint dsize, gboolean cont);
69
70 void
71 classy_test_suite_add(ClassyTestSuite *suite, ClassyTest *test);
72
73 /*---------------------------------------------------------------------------*/
74
75 G_END_DECLS
76 #endif /* CLASSY_TEST_SUITE_H */