| 1 | /* |
| 2 | * %injeqt copyright begin% |
| 3 | * Copyright 2015 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 | injeqtcxx . . $ injeqt/::injectorcxx . . $ injeqt/v1/injector# global_injectorcxx . . $ global_injector.; |
| 27 | |
| 28 | class injectablecxx . . $ injectable#; |
| 29 | |
| 30 | class injeqt_into_mecxx . . $ injeqt_into_me# : public QObjectcxx . . $ QObject# |
| 31 | { |
| 32 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 33 | |
| 34 | public: |
| 35 | injeqt_into_mecxx . . $ injeqt_into_me#injeqt_into_me(49f6e7a06ebc5aa8).() {} |
| 36 | virtual ~cxx . . $ injeqt_into_me#`~injeqt_into_me`(49f6e7a06ebc5aa8).injeqt_into_mecxx . . $ injeqt_into_me#() {} |
| 37 | |
| 38 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 39 | INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void set_injectablecxx . . $ injeqt_into_me#set_injectable(30106c792cc199a7).(injectablecxx . . $ injectable# *) {} |
| 40 | |
| 41 | }; |
| 42 | |
| 43 | class injectablecxx . . $ injectable# : public QObjectcxx . . $ QObject# |
| 44 | { |
| 45 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 46 | |
| 47 | public: |
| 48 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! injectablecxx . . $ injectable#injectable(49f6e7a06ebc5aa8).() {} |
| 49 | virtual ~cxx . . $ injectable#`~injectable`(49f6e7a06ebc5aa8).injectablecxx . . $ injectable#() {} |
| 50 | |
| 51 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 52 | INJEQT_INITcxx . . $ `include/injeqt/injeqt.h:32:11`! void initcxx . . $ injectable#init(49f6e7a06ebc5aa8).() |
| 53 | { |
| 54 | injeqt_into_mecxx . . $ injeqt_into_me# ocxx . . $ injeqt_into_me#injeqt_into_me(49f6e7a06ebc5aa8).; |
| 55 | global_injectorcxx . . $ global_injector..inject_intocxx . . $ injeqt/v1/injector#inject_into(749de1b6ae65bddd).(&o); |
| 56 | } |
| 57 | |
| 58 | }; |
| 59 | |
| 60 | class inject_into_during_init_testcxx . . $ inject_into_during_init_test# : public QObjectcxx . . $ QObject# |
| 61 | { |
| 62 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 63 | |
| 64 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 65 | void should_properly_inject_into_during_initcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).(); |
| 66 | |
| 67 | }; |
| 68 | |
| 69 | void inject_into_during_init_testcxx . . $ inject_into_during_init_test#::should_properly_inject_into_during_initcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).() |
| 70 | { |
| 71 | class mcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).m# : public injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module# |
| 72 | { |
| 73 | public: |
| 74 | mcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).m#m(49f6e7a06ebc5aa8).() |
| 75 | { |
| 76 | add_typecxx . . $ injeqt/v1/module#add_type(49f6e7a06ebc5aa8).<injectablecxx . . $ injectable#>(); |
| 77 | } |
| 78 | virtual ~cxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).m#`~m`(49f6e7a06ebc5aa8).mcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).m#() {} |
| 79 | }; |
| 80 | |
| 81 | auto modules = stdcxx . . $ std/vector#vector(b1ea180184b47f03).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<injeqtcxx . . $ injeqt/::modulecxx . . $ injeqt/v1/module#>>{}; |
| 82 | modules.emplace_backcxx . . $ std/vector#emplace_back(b3d147e3bb711c35).(stdcxx . . $ std/unique_ptr#unique_ptr(57bc6b0441bf5294).::unique_ptrcxx . . $ std/unique_ptr#<mcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).m#>{new mcxx . . $ inject_into_during_init_test#should_properly_inject_into_during_init(49f6e7a06ebc5aa8).m#{}}); |
| 83 | global_injectorcxx . . $ global_injector. =cxx . . $ injeqt/v1/injector#`operator=`(ffc2d299bdbadb1f). injeqtcxx . . $ injeqt/v1/injector#injector(282309f3f315010d).::injectorcxx . . $ injeqt/v1/injector#{stdcxx . . $ std/vector#vector(b1ea180184b47f03).::movecxx . . $ std/move(e7c6c0c8363dcc46).(modules)}; |
| 84 | global_injectorcxx . . $ global_injector..getcxx . . $ injeqt/v1/injector#get(155dc7f103cdb9db).<injectablecxx . . $ injectable#>(); |
| 85 | } |
| 86 | |
| 87 | QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(inject_into_during_init_test) |
| 88 | #include "inject-into-during-init-test.moc"cxx . . $ `<file>/build/test/inject-into-during-init-test_autogen/include/inject-into-during-init-test.moc`/ |