Debian Codegraph @

test/unit/type-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 #include "utils.h"cxx . . $ `<file>/test/unit/utils.h`/
23
24 #include <injeqt/type.h>cxx . . $ `<file>/include/injeqt/type.h`/
25
26 #include <QtTest/QtTest>
27
28 using namespace injeqtcxx . . $ injeqt/::v1;
29
30 class type_testcxx . . $ type_test# : public QObjectcxx . . $ QObject#
31 {
32 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
33
34 private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!:
35 void should_return_empty_when_created_with_null_meta_objectcxx . . $ type_test#should_return_empty_when_created_with_null_meta_object(49f6e7a06ebc5aa8).();
36 void should_return_qobject_when_created_with_qobject_meta_objectcxx . . $ type_test#should_return_qobject_when_created_with_qobject_meta_object(49f6e7a06ebc5aa8).();
37 void should_return_valid_meta_objectcxx . . $ type_test#should_return_valid_meta_object(49f6e7a06ebc5aa8).();
38 void should_properly_comparecxx . . $ type_test#should_properly_compare(49f6e7a06ebc5aa8).();
39
40 };
41
42 class valid_typecxx . . $ valid_type# : public QObjectcxx . . $ QObject#
43 {
44 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
45 };
46
47 class valid_type2cxx . . $ valid_type2# : public QObjectcxx . . $ QObject#
48 {
49 Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`!
50 };
51
52 void type_testcxx . . $ type_test#::should_return_empty_when_created_with_null_meta_objectcxx . . $ type_test#should_return_empty_when_created_with_null_meta_object(49f6e7a06ebc5aa8).()
53 {
54 auto t = typecxx . . $ injeqt/v1/type#type(f870fe3066718694).{nullptr};
55 QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(t.is_empty());
56 }
57
58 void type_testcxx . . $ type_test#::should_return_qobject_when_created_with_qobject_meta_objectcxx . . $ type_test#should_return_qobject_when_created_with_qobject_meta_object(49f6e7a06ebc5aa8).()
59 {
60 auto t = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<QObjectcxx . . $ QObject#>();
61 QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(!t.is_empty());
62 QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(t.is_qobject());
63 }
64
65 void type_testcxx . . $ type_test#::should_return_valid_meta_objectcxx . . $ type_test#should_return_valid_meta_object(49f6e7a06ebc5aa8).()
66 {
67 auto t = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<valid_typecxx . . $ valid_type#>();
68
69 QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(t.meta_object(), &valid_type::staticMetaObject);
70 }
71
72 void type_testcxx . . $ type_test#::should_properly_comparecxx . . $ type_test#should_properly_compare(49f6e7a06ebc5aa8).()
73 {
74 auto t1a = typecxx . . $ injeqt/v1/type#type(49f6e7a06ebc5aa8).{};
75 auto t1b = typecxx . . $ injeqt/v1/type#type(49f6e7a06ebc5aa8).{};
76 auto t2a = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<QObjectcxx . . $ QObject#>();
77 auto t2b = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<QObjectcxx . . $ QObject#>();
78 auto t3a = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<valid_typecxx . . $ valid_type#>();
79 auto t3b = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<valid_typecxx . . $ valid_type#>();
80 auto t4a = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<valid_type2cxx . . $ valid_type2#>();
81 auto t4b = make_typecxx . . $ injeqt/v1/make_type(10a1ed948a80d481).<valid_type2cxx . . $ valid_type2#>();
82
83 test_compare_excxx . . $ injeqt/v1/test_compare_ex(1f10a48923f889af).<typecxx . . $ injeqt/v1/type#>({cxx . . $ std/vector#vector(9619226211e5a241).{t1a, t1b}, {t2a, t2b}, {t3a, t3b}, {t4a, t4b}});
84 }
85
86 QTEST_APPLESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:442:9`!(type_test)
87 #include "type-test.moc"cxx . . $ `<file>/build/test/type-test_autogen/include/type-test.moc`/