Debian Codegraph @

test/unit/provider-by-default-constructor-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 "expect.h"cxx . . $ `<file>/test/unit/expect.h`/
22
23 #include "internal/injector-core.h"cxx . . $ `<file>/src/internal/injector-core.h`/
24 #include "internal/provider-by-default-constructor.h"cxx . . $ `<file>/src/internal/provider-by-default-constructor.h`/
25
26 #include <QtTest/QtTest>
27 #include <memory>
28
29 using namespace injeqtcxx . . $ injeqt/::v1;
30 using namespace injeqtcxx . . $ injeqt/::internal;
31
32 class default_constructor_typecxx . . $ default_constructor_type# : public QObjectcxx . . $ QObject#
33 {
34 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
35
36 public:
37 Q_INVOKABLEcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:124:9`! default_constructor_typecxx . . $ default_constructor_type#default_constructor_type(49f6e7a06ebc5aa8).() {}
38
39 };
40
41 class provider_by_default_constructor_testcxx . . $ provider_by_default_constructor_test# : public QObjectcxx . . $ QObject#
42 {
43 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
44
45 private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!:
46 void should_return_always_the_same_objectcxx . . $ provider_by_default_constructor_test#should_return_always_the_same_object(49f6e7a06ebc5aa8).();
47
48 };
49
50 void provider_by_default_constructor_testcxx . . $ provider_by_default_constructor_test#::should_return_always_the_same_objectcxx . . $ provider_by_default_constructor_test#should_return_always_the_same_object(49f6e7a06ebc5aa8).()
51 {
52 auto empty_injector1 = injector_corecxx . . $ injeqt/internal/injector_core#injector_core(528a6fa5a342ea28).{};
53 auto empty_injector2 = injector_corecxx . . $ injeqt/internal/injector_core#injector_core(528a6fa5a342ea28).{};
54 auto c = make_default_constructor_methodcxx . . $ injeqt/internal/make_default_constructor_method(84114e33f83ca37c).(make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<default_constructor_typecxx . . $ default_constructor_type#>());
55 auto p = stdcxx . . $ std/unique_ptr#unique_ptr(d6762fce684538e4).::unique_ptrcxx . . $ std/unique_ptr#<provider_by_default_constructorcxx . . $ injeqt/internal/provider_by_default_constructor#>{new provider_by_default_constructorcxx . . $ injeqt/internal/provider_by_default_constructor#{c}};
56
57 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(p->provided_type(), make_type<default_constructor_type>());
58 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(p->required_types(), types{});
59 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(p->constructor(), c);
60
61 auto o = p->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).providecxx . . $ injeqt/internal/provider_by_default_constructor#provide(51123600412ca135).(empty_injector1);
62 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(p->provide(empty_injector1), o);
63 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(p->provide(empty_injector2), o);
64 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(o->metaObject(), &default_constructor_type::staticMetaObject);
65 }
66
67 QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(provider_by_default_constructor_test)
68 #include "provider-by-default-constructor-test.moc"cxx . . $ `<file>/build/test/provider-by-default-constructor-test_autogen/include/provider-by-default-constructor-test.moc`/