Debian Codegraph @

test/integration/default-constructor-behavior-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 <injeqt/injector.h>cxx . . $ `<file>/include/injeqt/injector.h`/
22 #include <injeqt/module.h>cxx . . $ `<file>/include/injeqt/module.h`/
23
24 #include <QtTest/QtTest>
25
26 class int_containercxx . . $ int_container# : public QObjectcxx . . $ QObject#
27 {
28 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
29
30 public:
31 int_containercxx . . $ int_container#int_container(49f6e7a06ebc5aa8).() {}
32 virtual ~cxx . . $ int_container#`~int_container`(49f6e7a06ebc5aa8).int_containercxx . . $ int_container#() {}
33 virtual int valuecxx . . $ int_container#value(455f465bc33b4cdf).() const = 0;
34
35 };
36
37 class nine_containercxx . . $ nine_container# : public int_containercxx . . $ int_container#
38 {
39 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
40
41 public:
42 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! nine_containercxx . . $ nine_container#nine_container(49f6e7a06ebc5aa8).() {}
43 virtual ~cxx . . $ nine_container#`~nine_container`(49f6e7a06ebc5aa8).nine_containercxx . . $ nine_container#() {}
44 virtual int valuecxx . . $ nine_container#value(455f465bc33b4cdf).() const override { return 9; }
45
46 };
47
48 class base_int_servicecxx . . $ base_int_service# : public QObjectcxx . . $ QObject#
49 {
50 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
51
52 public:
53 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! base_int_servicecxx . . $ base_int_service#base_int_service(49f6e7a06ebc5aa8).() {}
54 int valuecxx . . $ base_int_service#value(455f465bc33b4cdf).() const { return _int_containercxx . . $ base_int_service#_int_container.->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).valuecxx . . $ int_container#value(455f465bc33b4cdf).(); }
55
56 private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!:
57 INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void set_int_containercxx . . $ base_int_service#set_int_container(e6e2b3d20ed44962).(int_containercxx . . $ int_container# *container)
58 {
59 _int_containercxx . . $ base_int_service#_int_container. =cxx . . $ QPointer#`operator=`(500fb76d9e491ab0). container;
60 }
61
62 private:
63 QPointercxx . . $ QPointer#<int_containercxx . . $ int_container#> _int_containercxx . . $ base_int_service#_int_container.;
64
65 };
66
67 class int_servicecxx . . $ int_service# : public base_int_servicecxx . . $ base_int_service#
68 {
69 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
70
71 public:
72 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! int_servicecxx . . $ int_service#int_service(49f6e7a06ebc5aa8).() {}
73
74 };
75
76 class default_constructor_behavior_testcxx . . $ default_constructor_behavior_test# : public QObjectcxx . . $ QObject#
77 {
78 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
79
80 private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!:
81 void should_create_proper_object_structurecxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).();
82
83 };
84
85 void default_constructor_behavior_testcxx . . $ default_constructor_behavior_test#::should_create_proper_object_structurecxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).()
86 {
87 class mcxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).m# : public injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#
88 {
89 public:
90 mcxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).m#m(49f6e7a06ebc5aa8).()
91 {
92 add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<int_servicecxx . . $ int_service#>();
93 add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<nine_containercxx . . $ nine_container#>();
94 }
95 virtual ~cxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).m#`~m`(49f6e7a06ebc5aa8).mcxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).m#() {}
96 };
97
98 auto modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{};
99 modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/unique_ptr#unique_ptr(57bc6b0441bf5294).::unique_ptrcxx . . $ std/unique_ptr#<mcxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).m#>{new mcxx . . $ default_constructor_behavior_test#should_create_proper_object_structure(49f6e7a06ebc5aa8).m#{}});
100 auto injector = injeqtcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).::injectorcxx . . $ injeqt/v1/injector#{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(modules)};
101 auto service = injector.getcxx . . $ injeqt/v1/injector#get(155dc7f103cdb9db).<int_servicecxx . . $ int_service#>();
102 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(9, service->value());
103 }
104
105 QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(default_constructor_behavior_test)
106 #include "default-constructor-behavior-test.moc"cxx . . $ `<file>/build/test/default-constructor-behavior-test_autogen/include/default-constructor-behavior-test.moc`/