| 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 "utils.h"cxx . . $ `<file>/test/unit/utils.h`/ |
| 22 | |
| 23 | #include "internal/dependency.h"cxx . . $ `<file>/src/internal/dependency.h`/ |
| 24 | |
| 25 | #include <QtTest/QtTest> |
| 26 | |
| 27 | using namespace injeqtcxx . . $ injeqt/::internal; |
| 28 | using namespace injeqtcxx . . $ injeqt/::v1; |
| 29 | |
| 30 | class type_1cxx . . $ type_1# : public QObjectcxx . . $ QObject# |
| 31 | { |
| 32 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 33 | }; |
| 34 | |
| 35 | class type_2cxx . . $ type_2# : public QObjectcxx . . $ QObject# |
| 36 | { |
| 37 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 38 | }; |
| 39 | |
| 40 | class type_with_dependencycxx . . $ type_with_dependency# : public QObjectcxx . . $ QObject# |
| 41 | { |
| 42 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 43 | |
| 44 | public slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 45 | INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void setter_1cxx . . $ type_with_dependency#setter_1(2eff8f70aeb41f67).(type_1cxx . . $ type_1# *) { } |
| 46 | INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void setter_1bcxx . . $ type_with_dependency#setter_1b(2eff8f70aeb41f67).(type_1cxx . . $ type_1# *) { } |
| 47 | INJEQT_SETcxx . . $ `include/injeqt/injeqt.h:34:11`! void setter_2cxx . . $ type_with_dependency#setter_2(710a7ba155b447df).(type_2cxx . . $ type_2# *) { } |
| 48 | |
| 49 | }; |
| 50 | |
| 51 | class dependency_testcxx . . $ dependency_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_create_valid_dependencycxx . . $ dependency_test#should_create_valid_dependency(49f6e7a06ebc5aa8).(); |
| 57 | void should_properly_comparecxx . . $ dependency_test#should_properly_compare(49f6e7a06ebc5aa8).(); |
| 58 | |
| 59 | }; |
| 60 | |
| 61 | void dependency_testcxx . . $ dependency_test#::should_create_valid_dependencycxx . . $ dependency_test#should_create_valid_dependency(49f6e7a06ebc5aa8).() |
| 62 | { |
| 63 | auto s = make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_1cxx . . $ type_1#>("setter_1(type_1*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 64 | auto d = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{s}; |
| 65 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(d.required_type(), make_type<type_1>()); |
| 66 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(d.setter(), s); |
| 67 | } |
| 68 | |
| 69 | void dependency_testcxx . . $ dependency_test#::should_properly_comparecxx . . $ dependency_test#should_properly_compare(49f6e7a06ebc5aa8).() |
| 70 | { |
| 71 | auto s1a = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_1cxx . . $ type_1#>("setter_1(type_1*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)}; |
| 72 | auto s1b = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_1cxx . . $ type_1#>("setter_1(type_1*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)}; |
| 73 | auto s2a = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_1cxx . . $ type_1#>("setter_1b(type_1*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)}; |
| 74 | auto s2b = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_1cxx . . $ type_1#>("setter_1b(type_1*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)}; |
| 75 | auto s3a = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_2cxx . . $ type_2#>("setter_2(type_2*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)}; |
| 76 | auto s3b = dependencycxx . . $ injeqt/internal/dependency#dependency(28c822c801d90b7b).{make_test_setter_methodcxx . . $ injeqt/v1/make_test_setter_method(fd45cf8d4adedf1d).<type_with_dependencycxx . . $ type_with_dependency#, type_2cxx . . $ type_2#>("setter_2(type_2*)"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)}; |
| 77 | |
| 78 | test_comparecxx . . $ injeqt/v1/test_compare(1f10a48923f889af).<dependencycxx . . $ injeqt/internal/dependency#>({cxx . . $ std/vector#vector(9619226211e5a241).{s1a, s1b}, {s2a, s2b}, {s3a, s3b}}); |
| 79 | } |
| 80 | |
| 81 | QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(dependency_test) |
| 82 | #include "dependency-test.moc"cxx . . $ `<file>/build/test/dependency-test_autogen/include/dependency-test.moc`/ |