| 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 "expect.h"cxx . . $ `<file>/test/unit/expect.h`/ |
| 22 | #include "utils.h"cxx . . $ `<file>/test/unit/utils.h`/ |
| 23 | |
| 24 | #include <injeqt/exception/ambiguous-types.h>cxx . . $ `<file>/include/injeqt/exception/ambiguous-types.h`/ |
| 25 | #include <injeqt/exception/qobject-type.h>cxx . . $ `<file>/include/injeqt/exception/qobject-type.h`/ |
| 26 | #include <injeqt/exception/unknown-type.h>cxx . . $ `<file>/include/injeqt/exception/unknown-type.h`/ |
| 27 | #include <injeqt/exception/unresolvable-dependencies.h>cxx . . $ `<file>/include/injeqt/exception/unresolvable-dependencies.h`/ |
| 28 | #include <injeqt/injector.h>cxx . . $ `<file>/include/injeqt/injector.h`/ |
| 29 | #include <injeqt/module.h>cxx . . $ `<file>/include/injeqt/module.h`/ |
| 30 | #include <injeqt/type.h>cxx . . $ `<file>/include/injeqt/type.h`/ |
| 31 | |
| 32 | #include <QtTest/QtTest> |
| 33 | #include <string> |
| 34 | |
| 35 | using namespace injeqtcxx . . $ injeqt/::internal; |
| 36 | using namespace injeqtcxx . . $ injeqt/::v1; |
| 37 | |
| 38 | class type_1cxx . . $ type_1# : public QObjectcxx . . $ QObject# |
| 39 | { |
| 40 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 41 | public: |
| 42 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! type_1cxx . . $ type_1#type_1(49f6e7a06ebc5aa8).() {} |
| 43 | }; |
| 44 | |
| 45 | class type_1_subtype_1cxx . . $ type_1_subtype_1# : public type_1cxx . . $ type_1# |
| 46 | { |
| 47 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 48 | public: |
| 49 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! type_1_subtype_1cxx . . $ type_1_subtype_1#type_1_subtype_1(49f6e7a06ebc5aa8).() {} |
| 50 | }; |
| 51 | |
| 52 | class type_1_subtype_2cxx . . $ type_1_subtype_2# : public type_1cxx . . $ type_1# |
| 53 | { |
| 54 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 55 | public: |
| 56 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! type_1_subtype_2cxx . . $ type_1_subtype_2#type_1_subtype_2(49f6e7a06ebc5aa8).() {} |
| 57 | }; |
| 58 | |
| 59 | class require_common_typecxx . . $ require_common_type# : public QObjectcxx . . $ QObject# |
| 60 | { |
| 61 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 62 | public: |
| 63 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! require_common_typecxx . . $ require_common_type#require_common_type(49f6e7a06ebc5aa8).() {} |
| 64 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 65 | INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void set_type_1cxx . . $ require_common_type#set_type_1(2eff8f70aeb41f67).(type_1cxx . . $ type_1# *) { } |
| 66 | }; |
| 67 | |
| 68 | class created_by_factorycxx . . $ created_by_factory# : public QObjectcxx . . $ QObject# |
| 69 | { |
| 70 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 71 | public: |
| 72 | created_by_factorycxx . . $ created_by_factory#created_by_factory(49f6e7a06ebc5aa8).() {} |
| 73 | }; |
| 74 | |
| 75 | class default_constructible_factorycxx . . $ default_constructible_factory# : public QObjectcxx . . $ QObject# |
| 76 | { |
| 77 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 78 | public: |
| 79 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! default_constructible_factorycxx . . $ default_constructible_factory#default_constructible_factory(49f6e7a06ebc5aa8).() {} |
| 80 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! created_by_factorycxx . . $ created_by_factory# * createcxx . . $ default_constructible_factory#create(e25d0d0c1cc7f5bd).() { return new created_by_factorycxx . . $ created_by_factory#{}; } |
| 81 | }; |
| 82 | |
| 83 | class ready_typecxx . . $ ready_type# : public QObjectcxx . . $ QObject# |
| 84 | { |
| 85 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 86 | }; |
| 87 | |
| 88 | class subinjector_objectcxx . . $ subinjector_object# : public QObjectcxx . . $ QObject# |
| 89 | { |
| 90 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 91 | public: |
| 92 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! subinjector_objectcxx . . $ subinjector_object#subinjector_object(49f6e7a06ebc5aa8).() {} |
| 93 | created_by_factorycxx . . $ created_by_factory# *_xcxx . . $ subinjector_object#_x.; |
| 94 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 95 | INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void set_created_by_factorycxx . . $ subinjector_object#set_created_by_factory(1d1c9c8616d3e9f1).(created_by_factorycxx . . $ created_by_factory# *x) { _xcxx . . $ subinjector_object#_x. = x; } |
| 96 | }; |
| 97 | |
| 98 | class test_modulecxx . . $ test_module# : public modulecxx . . $ injeqt/v1/module# |
| 99 | { |
| 100 | public: |
| 101 | test_modulecxx . . $ test_module#test_module(49f6e7a06ebc5aa8).() |
| 102 | { |
| 103 | _ready_objectcxx . . $ test_module#_ready_object. =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). stdcxx . . $ std/unique_ptr#unique_ptr(57bc6b0441bf5294).::unique_ptrcxx . . $ std/unique_ptr#<ready_typecxx . . $ ready_type#>{new ready_typecxx . . $ ready_type#{}}; |
| 104 | |
| 105 | add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<type_1_subtype_1cxx . . $ type_1_subtype_1#>(); |
| 106 | add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<default_constructible_factorycxx . . $ default_constructible_factory#>(); |
| 107 | add_factorycxx . . $ injeqt/v1/module#add_factory(49f6e7a06ebc5aa8).<created_by_factorycxx . . $ created_by_factory#, default_constructible_factorycxx . . $ default_constructible_factory#>(); |
| 108 | add_ready_objectcxx . . $ injeqt/v1/module#add_ready_object(749de1b6ae65bddd).<ready_typecxx . . $ ready_type#>(_ready_objectcxx . . $ test_module#_ready_object..getcxx . . $ std/unique_ptr#get(ca399b2b6292c808).()); |
| 109 | } |
| 110 | private: |
| 111 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<ready_typecxx . . $ ready_type#> _ready_objectcxx . . $ test_module#_ready_object.; |
| 112 | }; |
| 113 | |
| 114 | class test_submodulecxx . . $ test_submodule# : public modulecxx . . $ injeqt/v1/module# |
| 115 | { |
| 116 | public: |
| 117 | test_submodulecxx . . $ test_submodule#test_submodule(49f6e7a06ebc5aa8).() |
| 118 | { |
| 119 | add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<subinjector_objectcxx . . $ subinjector_object#>(); |
| 120 | } |
| 121 | }; |
| 122 | |
| 123 | class disable_common_supertype_submodulecxx . . $ disable_common_supertype_submodule# : public modulecxx . . $ injeqt/v1/module# |
| 124 | { |
| 125 | public: |
| 126 | disable_common_supertype_submodulecxx . . $ disable_common_supertype_submodule#disable_common_supertype_submodule(49f6e7a06ebc5aa8).() |
| 127 | { |
| 128 | add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<type_1_subtype_2cxx . . $ type_1_subtype_2#>(); |
| 129 | add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<require_common_typecxx . . $ require_common_type#>(); |
| 130 | } |
| 131 | }; |
| 132 | |
| 133 | class injector_testcxx . . $ injector_test# : public QObjectcxx . . $ QObject# |
| 134 | { |
| 135 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 136 | |
| 137 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 138 | void should_create_empty_injectorcxx . . $ injector_test#should_create_empty_injector(49f6e7a06ebc5aa8).(); |
| 139 | void should_not_accept_qobject_typecxx . . $ injector_test#should_not_accept_qobject_type(49f6e7a06ebc5aa8).(); |
| 140 | void should_not_accept_unknown_typecxx . . $ injector_test#should_not_accept_unknown_type(49f6e7a06ebc5aa8).(); |
| 141 | void should_create_valid_injectorcxx . . $ injector_test#should_create_valid_injector(49f6e7a06ebc5aa8).(); |
| 142 | void should_handle_subinjectorcxx . . $ injector_test#should_handle_subinjector(49f6e7a06ebc5aa8).(); |
| 143 | void should_not_accept_double_superinjectorcxx . . $ injector_test#should_not_accept_double_superinjector(49f6e7a06ebc5aa8).(); |
| 144 | void should_disable_common_type_in_superinjectorcxx . . $ injector_test#should_disable_common_type_in_superinjector(49f6e7a06ebc5aa8).(); |
| 145 | void should_allow_movecxx . . $ injector_test#should_allow_move(49f6e7a06ebc5aa8).(); |
| 146 | |
| 147 | }; |
| 148 | |
| 149 | class not_configured_typecxx . . $ not_configured_type# : public QObjectcxx . . $ QObject# |
| 150 | { |
| 151 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 152 | }; |
| 153 | |
| 154 | void injector_testcxx . . $ injector_test#::should_create_empty_injectorcxx . . $ injector_test#should_create_empty_injector(49f6e7a06ebc5aa8).() |
| 155 | { |
| 156 | injectorcxx . . $ injeqt/v1/injector#injector(49f6e7a06ebc5aa8).{}; |
| 157 | } |
| 158 | |
| 159 | void injector_testcxx . . $ injector_test#::should_not_accept_qobject_typecxx . . $ injector_test#should_not_accept_qobject_type(49f6e7a06ebc5aa8).() |
| 160 | { |
| 161 | auto i = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{}; |
| 162 | |
| 163 | expectcxx . . $ expect(13411efb8aeb1b14).<exceptioncxx . . $ injeqt/v1/exception/::qobject_typecxx . . $ injeqt/v1/exception/qobject_type#>([cxx . . $ std/function#function(a4b4b0c4acad1616).&](){ |
| 164 | i.getcxx . . $ injeqt/v1/injector#get(155dc7f103cdb9db).<QObjectcxx . . $ QObject#>(); |
| 165 | }); |
| 166 | } |
| 167 | |
| 168 | void injector_testcxx . . $ injector_test#::should_not_accept_unknown_typecxx . . $ injector_test#should_not_accept_unknown_type(49f6e7a06ebc5aa8).() |
| 169 | { |
| 170 | auto i = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{}; |
| 171 | |
| 172 | expectcxx . . $ expect(d99b926da2bbc072).<exceptioncxx . . $ injeqt/v1/exception/::unknown_typecxx . . $ injeqt/v1/exception/unknown_type#>({cxx . . $ std/vector#vector(9619226211e5a241)."default_constructible_factory"}, [cxx . . $ std/function#function(a4b4b0c4acad1616).&](){ |
| 173 | i.getcxx . . $ injeqt/v1/injector#get(155dc7f103cdb9db).<default_constructible_factorycxx . . $ default_constructible_factory#>(); |
| 174 | }); |
| 175 | } |
| 176 | |
| 177 | void injector_testcxx . . $ injector_test#::should_create_valid_injectorcxx . . $ injector_test#should_create_valid_injector(49f6e7a06ebc5aa8).() |
| 178 | { |
| 179 | auto modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 180 | modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_modulecxx . . $ test_module#>(new test_modulecxx . . $ test_module#{})); |
| 181 | auto i = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(modules)}; |
| 182 | |
| 183 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(i.get<created_by_factory>() != nullptr); |
| 184 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(i.get<default_constructible_factory>() != nullptr); |
| 185 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(i.get<ready_type>() != nullptr); |
| 186 | |
| 187 | expectcxx . . $ expect(d99b926da2bbc072).<exceptioncxx . . $ injeqt/v1/exception/::unknown_typecxx . . $ injeqt/v1/exception/unknown_type#>({cxx . . $ std/vector#vector(9619226211e5a241)."not_configured_type"}, [cxx . . $ std/function#function(a4b4b0c4acad1616).&](){ |
| 188 | i.getcxx . . $ injeqt/v1/injector#get(155dc7f103cdb9db).<not_configured_typecxx . . $ not_configured_type#>(); |
| 189 | }); |
| 190 | } |
| 191 | |
| 192 | void injector_testcxx . . $ injector_test#::should_handle_subinjectorcxx . . $ injector_test#should_handle_subinjector(49f6e7a06ebc5aa8).() |
| 193 | { |
| 194 | auto super_modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 195 | super_modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_modulecxx . . $ test_module#>(new test_modulecxx . . $ test_module#{})); |
| 196 | auto super_injector = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(super_modules)}; |
| 197 | |
| 198 | auto super_injectors = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<injectorcxx . . $ injeqt/v1/injector# *>{&super_injector}; |
| 199 | auto sub_modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 200 | sub_modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_submodulecxx . . $ test_submodule#>(new test_submodulecxx . . $ test_submodule#{})); |
| 201 | auto sub_injector = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{super_injectorscxx . . $ std/vector#vector(a1201200cf0efa42)., stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(sub_modules)}; |
| 202 | |
| 203 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(sub_injector.get<subinjector_object>() != nullptr); |
| 204 | } |
| 205 | |
| 206 | void injector_testcxx . . $ injector_test#::should_not_accept_double_superinjectorcxx . . $ injector_test#should_not_accept_double_superinjector(49f6e7a06ebc5aa8).() |
| 207 | { |
| 208 | auto super_modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 209 | super_modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_modulecxx . . $ test_module#>(new test_modulecxx . . $ test_module#{})); |
| 210 | auto super_injector = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(super_modules)}; |
| 211 | |
| 212 | auto super_injectors = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<injectorcxx . . $ injeqt/v1/injector# *>{&super_injector, &super_injector}; |
| 213 | auto sub_modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 214 | sub_modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_submodulecxx . . $ test_submodule#>(new test_submodulecxx . . $ test_submodule#{})); |
| 215 | |
| 216 | expectcxx . . $ expect(d99b926da2bbc072).<exceptioncxx . . $ injeqt/v1/exception/::ambiguous_typescxx . . $ injeqt/v1/exception/ambiguous_types#>({cxx . . $ std/vector#vector(49f6e7a06ebc5aa8).}, [cxx . . $ std/function#function(a4b4b0c4acad1616).&]{ |
| 217 | injectorcxx . . $ injeqt/v1/injector#injector(7e05156fb307f012).{super_injectorscxx . . $ std/vector#vector(a1201200cf0efa42)., stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(sub_modules)}; |
| 218 | }); |
| 219 | } |
| 220 | |
| 221 | void injector_testcxx . . $ injector_test#::should_disable_common_type_in_superinjectorcxx . . $ injector_test#should_disable_common_type_in_superinjector(49f6e7a06ebc5aa8).() |
| 222 | { |
| 223 | auto super_modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 224 | super_modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_modulecxx . . $ test_module#>(new test_modulecxx . . $ test_module#{})); |
| 225 | auto super_injector = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(super_modules)}; |
| 226 | |
| 227 | auto super_injectors = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<injectorcxx . . $ injeqt/v1/injector# *>{&super_injector}; |
| 228 | auto sub_modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 229 | sub_modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<disable_common_supertype_submodulecxx . . $ disable_common_supertype_submodule#>(new disable_common_supertype_submodulecxx . . $ disable_common_supertype_submodule#{})); |
| 230 | |
| 231 | expectcxx . . $ expect(d99b926da2bbc072).<exceptioncxx . . $ injeqt/v1/exception/::unresolvable_dependenciescxx . . $ injeqt/v1/exception/unresolvable_dependencies#>({cxx . . $ std/vector#vector(9619226211e5a241)."type_1"}, [cxx . . $ std/function#function(a4b4b0c4acad1616).&]{ |
| 232 | injectorcxx . . $ injeqt/v1/injector#injector(7e05156fb307f012).{super_injectorscxx . . $ std/vector#vector(a1201200cf0efa42)., stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(sub_modules)}; |
| 233 | }); |
| 234 | } |
| 235 | |
| 236 | void injector_testcxx . . $ injector_test#::should_allow_movecxx . . $ injector_test#should_allow_move(49f6e7a06ebc5aa8).() |
| 237 | { |
| 238 | auto modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 239 | modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<test_modulecxx . . $ test_module#>(new test_modulecxx . . $ test_module#{})); |
| 240 | auto i = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(modules)}; |
| 241 | auto i2 = stdcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).::movecxx . . $ std/move(e7c6c0c8363dcc46).(i); |
| 242 | auto i3 = injectorcxx . . $ injeqt/v1/injector#injector(2c113f511709706a).{}; |
| 243 | i3 =cxx . . $ injeqt/v1/injector#`operator=`(ffc2d299bdbadb1f). stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(i2); |
| 244 | |
| 245 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(i3.get<created_by_factory>() != nullptr); |
| 246 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(i3.get<default_constructible_factory>() != nullptr); |
| 247 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(i3.get<ready_type>() != nullptr); |
| 248 | |
| 249 | expectcxx . . $ expect(d99b926da2bbc072).<exceptioncxx . . $ injeqt/v1/exception/::unknown_typecxx . . $ injeqt/v1/exception/unknown_type#>({cxx . . $ std/vector#vector(9619226211e5a241)."not_configured_type"}, [cxx . . $ std/function#function(a4b4b0c4acad1616).&](){ |
| 250 | i3.getcxx . . $ injeqt/v1/injector#get(155dc7f103cdb9db).<not_configured_typecxx . . $ not_configured_type#>(); |
| 251 | }); |
| 252 | } |
| 253 | |
| 254 | QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(injector_test) |
| 255 | #include "injector-test.moc"cxx . . $ `<file>/build/test/injector-test_autogen/include/injector-test.moc`/ |