Debian Codegraph @

test/unit/module-test.cpp

raw symbols SCIP
1 /*
2 * %injeqt copyright begin%
3 * Copyright 2014 Rafał Malinowski ([email protected])
4 * %injeqt copyright end%
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.1 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 Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "../mocks/mocked-provider.h"cxx . . $ `<file>/test/mocks/mocked-provider.h`/
22 #include "expect.h"cxx . . $ `<file>/test/unit/expect.h`/
23 #include "utils.h"cxx . . $ `<file>/test/unit/utils.h`/
24
25 #include <injeqt/module.h>cxx . . $ `<file>/include/injeqt/module.h`/
26
27 #include <QtTest/QtTest>
28 #include <string>
29
30 using namespace injeqtcxx . . $ injeqt/::internal;
31 using namespace injeqtcxx . . $ injeqt/::v1;
32
33 class not_default_constructible_typecxx . . $ not_default_constructible_type# : public QObjectcxx . . $ QObject#
34 {
35 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
36 };
37
38 class not_default_constructible_type_subtypecxx . . $ not_default_constructible_type_subtype# : public not_default_constructible_typecxx . . $ not_default_constructible_type#
39 {
40 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
41 };
42
43 class default_constructible_typecxx . . $ default_constructible_type# : public QObjectcxx . . $ QObject#
44 {
45 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
46 public:
47 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! default_constructible_typecxx . . $ default_constructible_type#default_constructible_type(49f6e7a06ebc5aa8).() {}
48 };
49
50 class factory_typecxx . . $ factory_type# : public QObjectcxx . . $ QObject#
51 {
52 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
53 public:
54 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! default_constructible_typecxx . . $ default_constructible_type# * createcxx . . $ factory_type#create(bf6287580e2c7ae6).() const { return nullptr; }
55 };
56
57 class factory_subtype_typecxx . . $ factory_subtype_type# : public QObjectcxx . . $ QObject#
58 {
59 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
60 public:
61 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! not_default_constructible_type_subtypecxx . . $ not_default_constructible_type_subtype# * createcxx . . $ factory_subtype_type#create(f893cbc4b84feb4d).() const { return nullptr; }
62 };
63
64 class factory_double_typecxx . . $ factory_double_type# : public QObjectcxx . . $ QObject#
65 {
66 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
67 public:
68 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! not_default_constructible_typecxx . . $ not_default_constructible_type# * create1cxx . . $ factory_double_type#create1(1e966d0f04132e9).() const { return nullptr; }
69 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! not_default_constructible_typecxx . . $ not_default_constructible_type# * create2cxx . . $ factory_double_type#create2(1e966d0f04132e9).() const { return nullptr; }
70 };
71
72 class module_testcxx . . $ module_test# : public QObjectcxx . . $ QObject#
73 {
74 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
75
76 private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!:
77 void should_accept_empty_modulecxx . . $ module_test#should_accept_empty_module(49f6e7a06ebc5aa8).();
78 void should_accept_null_ready_objectcxx . . $ module_test#should_accept_null_ready_object(49f6e7a06ebc5aa8).();
79 void should_accept_qobject_ready_objectcxx . . $ module_test#should_accept_qobject_ready_object(49f6e7a06ebc5aa8).();
80 void should_accept_valid_ready_objectcxx . . $ module_test#should_accept_valid_ready_object(49f6e7a06ebc5aa8).();
81 void should_accept_subtype_ready_objectcxx . . $ module_test#should_accept_subtype_ready_object(49f6e7a06ebc5aa8).();
82 void should_accept_supertype_ready_objectcxx . . $ module_test#should_accept_supertype_ready_object(49f6e7a06ebc5aa8).();
83 void should_accept_qobject_typecxx . . $ module_test#should_accept_qobject_type(49f6e7a06ebc5aa8).();
84 void should_accept_not_default_constructible_typecxx . . $ module_test#should_accept_not_default_constructible_type(49f6e7a06ebc5aa8).();
85 void should_accept_default_constructible_typecxx . . $ module_test#should_accept_default_constructible_type(49f6e7a06ebc5aa8).();
86 void should_accept_qobject_factory_typecxx . . $ module_test#should_accept_qobject_factory_type(49f6e7a06ebc5aa8).();
87 void should_accept_qobject_created_typecxx . . $ module_test#should_accept_qobject_created_type(49f6e7a06ebc5aa8).();
88 void should_accept_valid_factory_typecxx . . $ module_test#should_accept_valid_factory_type(49f6e7a06ebc5aa8).();
89 void should_accept_supertype_factory_typecxx . . $ module_test#should_accept_supertype_factory_type(49f6e7a06ebc5aa8).();
90 void should_accept_subtype_factory_typecxx . . $ module_test#should_accept_subtype_factory_type(49f6e7a06ebc5aa8).();
91 void should_accept_double_factory_typecxx . . $ module_test#should_accept_double_factory_type(49f6e7a06ebc5aa8).();
92
93 };
94
95 void module_testcxx . . $ module_test#::should_accept_empty_modulecxx . . $ module_test#should_accept_empty_module(49f6e7a06ebc5aa8).()
96 {
97 class test_modulecxx . . $ module_test#should_accept_empty_module(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module# { };
98
99 test_modulecxx . . $ module_test#should_accept_empty_module(49f6e7a06ebc5aa8).test_module#{};
100 }
101
102 void module_testcxx . . $ module_test#::should_accept_null_ready_objectcxx . . $ module_test#should_accept_null_ready_object(49f6e7a06ebc5aa8).()
103 {
104 class test_modulecxx . . $ module_test#should_accept_null_ready_object(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
105 {
106 public:
107 test_modulecxx . . $ module_test#should_accept_null_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
108 {
109 add_ready_objectcxx . . $ injeqt/v1/module#add_ready_object(749de1b6ae65bddd).<not_default_constructible_typecxx . . $ not_default_constructible_type#>(nullptr);
110 }
111 };
112
113 test_modulecxx . . $ module_test#should_accept_null_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
114 }
115
116 void module_testcxx . . $ module_test#::should_accept_qobject_ready_objectcxx . . $ module_test#should_accept_qobject_ready_object(49f6e7a06ebc5aa8).()
117 {
118 class test_modulecxx . . $ module_test#should_accept_qobject_ready_object(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
119 {
120 public:
121 test_modulecxx . . $ module_test#should_accept_qobject_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
122 {
123 not_default_constructible_typecxx . . $ not_default_constructible_type# object;
124 add_ready_objectcxx . . $ injeqt/v1/module#add_ready_object(749de1b6ae65bddd).<QObjectcxx . . $ QObject#>(&object);
125 }
126 };
127
128 test_modulecxx . . $ module_test#should_accept_qobject_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
129 }
130
131 void module_testcxx . . $ module_test#::should_accept_valid_ready_objectcxx . . $ module_test#should_accept_valid_ready_object(49f6e7a06ebc5aa8).()
132 {
133 class test_modulecxx . . $ module_test#should_accept_valid_ready_object(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
134 {
135 public:
136 test_modulecxx . . $ module_test#should_accept_valid_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
137 {
138 not_default_constructible_typecxx . . $ not_default_constructible_type# object;
139 add_ready_objectcxx . . $ injeqt/v1/module#add_ready_object(749de1b6ae65bddd).<not_default_constructible_typecxx . . $ not_default_constructible_type#>(&object);
140 }
141 };
142
143 test_modulecxx . . $ module_test#should_accept_valid_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
144 }
145
146 void module_testcxx . . $ module_test#::should_accept_subtype_ready_objectcxx . . $ module_test#should_accept_subtype_ready_object(49f6e7a06ebc5aa8).()
147 {
148 class test_modulecxx . . $ module_test#should_accept_subtype_ready_object(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
149 {
150 public:
151 test_modulecxx . . $ module_test#should_accept_subtype_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
152 {
153 not_default_constructible_type_subtypecxx . . $ not_default_constructible_type_subtype# object;
154 add_ready_objectcxx . . $ injeqt/v1/module#add_ready_object(749de1b6ae65bddd).<not_default_constructible_typecxx . . $ not_default_constructible_type#>(&object);
155 }
156 };
157
158 test_modulecxx . . $ module_test#should_accept_subtype_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
159 }
160
161 void module_testcxx . . $ module_test#::should_accept_supertype_ready_objectcxx . . $ module_test#should_accept_supertype_ready_object(49f6e7a06ebc5aa8).()
162 {
163 class test_modulecxx . . $ module_test#should_accept_supertype_ready_object(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
164 {
165 public:
166 test_modulecxx . . $ module_test#should_accept_supertype_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
167 {
168 not_default_constructible_typecxx . . $ not_default_constructible_type# object;
169 add_ready_objectcxx . . $ injeqt/v1/module#add_ready_object(749de1b6ae65bddd).<not_default_constructible_type_subtypecxx . . $ not_default_constructible_type_subtype#>(&object);
170 }
171 };
172
173 test_modulecxx . . $ module_test#should_accept_supertype_ready_object(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
174 }
175
176 void module_testcxx . . $ module_test#::should_accept_qobject_typecxx . . $ module_test#should_accept_qobject_type(49f6e7a06ebc5aa8).()
177 {
178 class test_modulecxx . . $ module_test#should_accept_qobject_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
179 {
180 public:
181 test_modulecxx . . $ module_test#should_accept_qobject_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
182 {
183 add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<QObjectcxx . . $ QObject#>();
184 }
185 };
186
187 test_modulecxx . . $ module_test#should_accept_qobject_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
188 }
189
190 void module_testcxx . . $ module_test#::should_accept_not_default_constructible_typecxx . . $ module_test#should_accept_not_default_constructible_type(49f6e7a06ebc5aa8).()
191 {
192 class test_modulecxx . . $ module_test#should_accept_not_default_constructible_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
193 {
194 public:
195 test_modulecxx . . $ module_test#should_accept_not_default_constructible_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
196 {
197 add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<not_default_constructible_typecxx . . $ not_default_constructible_type#>();
198 }
199 };
200
201 test_modulecxx . . $ module_test#should_accept_not_default_constructible_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
202 }
203
204 void module_testcxx . . $ module_test#::should_accept_default_constructible_typecxx . . $ module_test#should_accept_default_constructible_type(49f6e7a06ebc5aa8).()
205 {
206 class test_modulecxx . . $ module_test#should_accept_default_constructible_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
207 {
208 public:
209 test_modulecxx . . $ module_test#should_accept_default_constructible_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
210 {
211 add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<default_constructible_typecxx . . $ default_constructible_type#>();
212 }
213 };
214
215 test_modulecxx . . $ module_test#should_accept_default_constructible_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
216 }
217
218 void module_testcxx . . $ module_test#::should_accept_qobject_factory_typecxx . . $ module_test#should_accept_qobject_factory_type(49f6e7a06ebc5aa8).()
219 {
220 class test_modulecxx . . $ module_test#should_accept_qobject_factory_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
221 {
222 public:
223 test_modulecxx . . $ module_test#should_accept_qobject_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
224 {
225 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<not_default_constructible_typecxx . . $ not_default_constructible_type#, QObjectcxx . . $ QObject#>();
226 }
227 };
228
229 test_modulecxx . . $ module_test#should_accept_qobject_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
230 }
231
232 void module_testcxx . . $ module_test#::should_accept_qobject_created_typecxx . . $ module_test#should_accept_qobject_created_type(49f6e7a06ebc5aa8).()
233 {
234 class test_modulecxx . . $ module_test#should_accept_qobject_created_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
235 {
236 public:
237 test_modulecxx . . $ module_test#should_accept_qobject_created_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
238 {
239 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<QObjectcxx . . $ QObject#, factory_typecxx . . $ factory_type#>();
240 }
241 };
242
243 test_modulecxx . . $ module_test#should_accept_qobject_created_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
244 }
245
246 void module_testcxx . . $ module_test#::should_accept_valid_factory_typecxx . . $ module_test#should_accept_valid_factory_type(49f6e7a06ebc5aa8).()
247 {
248 class test_modulecxx . . $ module_test#should_accept_valid_factory_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
249 {
250 public:
251 test_modulecxx . . $ module_test#should_accept_valid_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
252 {
253 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<not_default_constructible_typecxx . . $ not_default_constructible_type#, factory_typecxx . . $ factory_type#>();
254 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<not_default_constructible_type_subtypecxx . . $ not_default_constructible_type_subtype#, factory_subtype_typecxx . . $ factory_subtype_type#>();
255 }
256 };
257
258 test_modulecxx . . $ module_test#should_accept_valid_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
259 }
260
261 void module_testcxx . . $ module_test#::should_accept_subtype_factory_typecxx . . $ module_test#should_accept_subtype_factory_type(49f6e7a06ebc5aa8).()
262 {
263 class test_modulecxx . . $ module_test#should_accept_subtype_factory_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
264 {
265 public:
266 test_modulecxx . . $ module_test#should_accept_subtype_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
267 {
268 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<not_default_constructible_type_subtypecxx . . $ not_default_constructible_type_subtype#, factory_typecxx . . $ factory_type#>();
269 }
270 };
271
272 test_modulecxx . . $ module_test#should_accept_subtype_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
273 }
274
275 void module_testcxx . . $ module_test#::should_accept_supertype_factory_typecxx . . $ module_test#should_accept_supertype_factory_type(49f6e7a06ebc5aa8).()
276 {
277 class test_modulecxx . . $ module_test#should_accept_supertype_factory_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
278 {
279 public:
280 test_modulecxx . . $ module_test#should_accept_supertype_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
281 {
282 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<not_default_constructible_typecxx . . $ not_default_constructible_type#, factory_subtype_typecxx . . $ factory_subtype_type#>();
283 }
284 };
285
286 test_modulecxx . . $ module_test#should_accept_supertype_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
287 }
288
289 void module_testcxx . . $ module_test#::should_accept_double_factory_typecxx . . $ module_test#should_accept_double_factory_type(49f6e7a06ebc5aa8).()
290 {
291 class test_modulecxx . . $ module_test#should_accept_double_factory_type(49f6e7a06ebc5aa8).test_module# : public modulecxx . . $ injeqt/v1/module#
292 {
293 public:
294 test_modulecxx . . $ module_test#should_accept_double_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).()
295 {
296 add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<not_default_constructible_typecxx . . $ not_default_constructible_type#, factory_double_typecxx . . $ factory_double_type#>();
297 }
298 };
299
300 test_modulecxx . . $ module_test#should_accept_double_factory_type(49f6e7a06ebc5aa8).test_module#test_module(49f6e7a06ebc5aa8).{};
301 }
302
303 QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(module_test)
304 #include "module-test.moc"cxx . . $ `<file>/build/test/module-test_autogen/include/module-test.moc`/