| 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-configuration.h"cxx . . $ `<file>/test/mocks/mocked-provider-configuration.h`/ |
| 22 | #include "expect.h"cxx . . $ `<file>/test/unit/expect.h`/ |
| 23 | #include "utils.h"cxx . . $ `<file>/test/unit/utils.h`/ |
| 24 | |
| 25 | #include "internal/module-impl.h"cxx . . $ `<file>/src/internal/module-impl.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 type_1cxx . . $ type_1# : public QObjectcxx . . $ QObject# |
| 34 | { |
| 35 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 36 | |
| 37 | public: |
| 38 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! type_1cxx . . $ type_1#type_1(49f6e7a06ebc5aa8).() {} |
| 39 | |
| 40 | }; |
| 41 | |
| 42 | class factory_type_1cxx . . $ factory_type_1# : public QObjectcxx . . $ QObject# |
| 43 | { |
| 44 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 45 | |
| 46 | public: |
| 47 | Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! type_1cxx . . $ type_1# * create_type_1cxx . . $ factory_type_1#create_type_1(dbbfb158899b29b1).() { return nullptr; } |
| 48 | |
| 49 | }; |
| 50 | |
| 51 | class module_impl_testcxx . . $ module_impl_test# : public QObjectcxx . . $ QObject# |
| 52 | { |
| 53 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 54 | |
| 55 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 56 | void should_properly_add_provider_configurationscxx . . $ module_impl_test#should_properly_add_provider_configurations(49f6e7a06ebc5aa8).(); |
| 57 | |
| 58 | }; |
| 59 | |
| 60 | void module_impl_testcxx . . $ module_impl_test#::should_properly_add_provider_configurationscxx . . $ module_impl_test#should_properly_add_provider_configurations(49f6e7a06ebc5aa8).() |
| 61 | { |
| 62 | auto m = module_implcxx . . $ injeqt/internal/module_impl#{}; |
| 63 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations().size(), size_t{0}); |
| 64 | |
| 65 | auto p1 = stdcxx . . $ std/shared_ptr#shared_ptr(c412da0edac25070).::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<mocked_provider_configurationcxx . . $ mocked_provider_configuration#>(); |
| 66 | m.add_provider_configurationcxx . . $ injeqt/internal/module_impl#add_provider_configuration(c60705b98aa39e39).(p1cxx . . $ std/shared_ptr#shared_ptr(c412da0edac25070).); |
| 67 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations().size(), size_t{1}); |
| 68 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations()[0].get(), p1.get()); |
| 69 | |
| 70 | auto p2 = stdcxx . . $ std/shared_ptr#shared_ptr(c412da0edac25070).::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<mocked_provider_configurationcxx . . $ mocked_provider_configuration#>(); |
| 71 | m.add_provider_configurationcxx . . $ injeqt/internal/module_impl#add_provider_configuration(c60705b98aa39e39).(p2cxx . . $ std/shared_ptr#shared_ptr(c412da0edac25070).); |
| 72 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations().size(), size_t{2}); |
| 73 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations()[0].get(), p1.get()); |
| 74 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations()[1].get(), p2.get()); |
| 75 | |
| 76 | auto p3 = stdcxx . . $ std/shared_ptr#shared_ptr(c412da0edac25070).::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<mocked_provider_configurationcxx . . $ mocked_provider_configuration#>(); |
| 77 | m.add_provider_configurationcxx . . $ injeqt/internal/module_impl#add_provider_configuration(c60705b98aa39e39).(p3cxx . . $ std/shared_ptr#shared_ptr(c412da0edac25070).); |
| 78 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations().size(), size_t{3}); |
| 79 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations()[0].get(), p1.get()); |
| 80 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations()[1].get(), p2.get()); |
| 81 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m.provider_configurations()[2].get(), p3.get()); |
| 82 | } |
| 83 | |
| 84 | QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(module_impl_test) |
| 85 | #include "module-impl-test.moc"cxx . . $ `<file>/build/test/module-impl-test_autogen/include/module-impl-test.moc`/ |