Merge ~panfaust/kubuntu-packaging/+git/step:work into ~kubuntu-packagers/kubuntu-packaging/+git/step:kubuntu_yakkety_archive

Proposed by Jose Manuel Santamaria Lema
Status: Merged
Merged at revision: ac11706d51d06fd164a72e71c97a37604046e5fc
Proposed branch: ~panfaust/kubuntu-packaging/+git/step:work
Merge into: ~kubuntu-packagers/kubuntu-packaging/+git/step:kubuntu_yakkety_archive
Diff against target: 225 lines (+0/-219)
1 file modified
dev/null (+0/-219)
Reviewer Review Type Date Requested Status
Kubuntu Packagers Pending
Review via email: mp+300797@code.launchpad.net

Description of the change

Delete an upstream file provided by the orig tarball. Our packaging repositories must contain only files under debian/*

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/autotests/test_metaobject.cc b/autotests/test_metaobject.cc
2deleted file mode 100644
3index 9ea7413..0000000
4--- a/autotests/test_metaobject.cc
5+++ /dev/null
6@@ -1,219 +0,0 @@
7-/* This file is part of Step
8- Copyright (C) 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com>
9-
10- StepCore library is free software; you can redistribute it and/or modify
11- it under the terms of the GNU General Public License as published by
12- the Free Software Foundation; either version 2 of the License, or
13- (at your option) any later version.
14-
15- StepCore library is distributed in the hope that it will be useful,
16- but WITHOUT ANY WARRANTY; without even the implied warranty of
17- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18- GNU General Public License for more details.
19-
20- You should have received a copy of the GNU General Public License
21- along with StepCore; if not, write to the Free Software
22- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23-*/
24-
25-#include "test_metaobject.h"
26-#include "stepcore/object.h"
27-#include <QString>
28-#include <QMetaType>
29-#include <QTest>
30-
31-struct MetaObjectTestType
32-{
33- int value;
34- MetaObjectTestType(int v): value(v) {}
35- MetaObjectTestType(): value(0) {}
36-};
37-Q_DECLARE_METATYPE( MetaObjectTestType )
38-
39-class MetaObjectTestInterface
40-{
41- STEPCORE_OBJECT(MetaObjectTestInterface)
42-
43-public:
44- virtual ~MetaObjectTestInterface() {}
45- double property1() const { return _property1; }
46- void setProperty1(double property1) { _property1 = property1; }
47-
48-protected:
49- double _property1;
50-};
51-
52-class MetaObjectTestObject: public StepCore::Object, public MetaObjectTestInterface
53-{
54- STEPCORE_OBJECT(MetaObjectTestObject)
55-
56-public:
57- int property2() const { return 2; }
58-
59- const MetaObjectTestType& property3() const { return _property3; }
60- void setProperty3(const MetaObjectTestType& property3) { _property3 = property3; }
61-
62- MetaObjectTestType property4() const { return _property4; }
63- bool setProperty4(MetaObjectTestType property4) {
64- if(property4.value < 0) return false;
65- _property4 = property4; return true;
66- }
67-
68-protected:
69- double _property2;
70- MetaObjectTestType _property3;
71- MetaObjectTestType _property4;
72-};
73-
74-namespace StepCore {
75-template<> inline QString typeToString(const MetaObjectTestType& v)
76-{
77- return QString::number(v.value);
78-}
79-
80-template<> inline MetaObjectTestType stringToType(const QString& s, bool* ok)
81-{
82- return MetaObjectTestType(s.toInt(ok));
83-}
84-
85-template<> inline MetaObjectTestType variantToType(const QVariant& v, bool* ok)
86-{
87- if(v.userType() == qMetaTypeId<MetaObjectTestType>()) {
88- *ok = true; return v.value<MetaObjectTestType>();
89- }
90- QVariant vc(v); *ok = vc.convert(QVariant::Int);
91- return MetaObjectTestType(vc.value<int>());
92-}
93-
94-}
95-
96-STEPCORE_META_OBJECT(MetaObjectTestInterface, "MetaObjectTestInterface", "TestInterface", StepCore::MetaObject::ABSTRACT,,
97- STEPCORE_PROPERTY_RW(double, property1, "property1", "m", "Property1", property1, setProperty1))
98-
99-STEPCORE_META_OBJECT(MetaObjectTestObject, "MetaObjectTestObject", "TestObject", 0,
100- STEPCORE_SUPER_CLASS(StepCore::Object) STEPCORE_SUPER_CLASS(MetaObjectTestInterface),
101- STEPCORE_PROPERTY_R (int, property2, "property2", STEPCORE_UNITS_1, "Property2", property2)
102- STEPCORE_PROPERTY_RW(MetaObjectTestType, property3, "property3", STEPCORE_UNITS_NULL, "Property3", property3, setProperty3)
103- STEPCORE_PROPERTY_RW(MetaObjectTestType, property4, "property4", STEPCORE_UNITS_NULL, "Property4", property4, setProperty4)
104- )
105-
106-void TestMetaobject::testMetaObject()
107-{
108- /* Abstract class: can't create */
109- QVERIFY( MetaObjectTestInterface::staticMetaObject()->isAbstract() );
110- QVERIFY( MetaObjectTestInterface::staticMetaObject()->newObject() == NULL );
111-
112- /* Normal class: should create */
113- QVERIFY( !MetaObjectTestObject::staticMetaObject()->isAbstract() );
114- StepCore::Object* object = MetaObjectTestObject::staticMetaObject()->newObject();
115- QVERIFY( object != NULL);
116- MetaObjectTestObject* testObject = dynamic_cast<MetaObjectTestObject*>(object);
117- QVERIFY( testObject != NULL );
118-
119- QVERIFY( object->metaObject() == MetaObjectTestObject::staticMetaObject() );
120-
121- /* Class name */
122- const StepCore::MetaObject* metaObject = testObject->metaObject();
123- QCOMPARE( QString(metaObject->className()), QString("MetaObjectTestObject") );
124-
125- /* Super classes list */
126- QCOMPARE( metaObject->superClassCount(), 2 );
127- QCOMPARE( QString(metaObject->superClass(0)->className()), QString("Object") );
128- QCOMPARE( QString(metaObject->superClass(1)->className()), QString("MetaObjectTestInterface") );
129-
130- /* Inheritance */
131- QVERIFY( metaObject->inherits(StepCore::Object::staticMetaObject()) );
132- QVERIFY( metaObject->inherits(MetaObjectTestInterface::staticMetaObject()) );
133- QVERIFY( metaObject->inherits(metaObject) );
134- QVERIFY( !MetaObjectTestInterface::staticMetaObject()->inherits(metaObject) );
135-
136- QVERIFY( metaObject->inherits("Object") );
137- QVERIFY( metaObject->inherits("MetaObjectTestInterface") );
138- QVERIFY( metaObject->inherits("MetaObjectTestObject") );
139- QVERIFY( !metaObject->inherits("NotClass") );
140- QVERIFY( !MetaObjectTestInterface::staticMetaObject()->inherits("MetaObjectTestObject") );
141-
142- /* Property count */
143- QCOMPARE( metaObject->classPropertyCount(), 3 );
144- QCOMPARE( metaObject->propertyCount(), 5 );
145-
146- /* Property lookup */
147- QVERIFY( metaObject->property("name") == metaObject->property(0) );
148- QVERIFY( metaObject->property("property1") == metaObject->property(1) );
149- QVERIFY( metaObject->property("property2") == metaObject->property(2) );
150- QVERIFY( metaObject->property("property3") == metaObject->property(3) );
151- QVERIFY( metaObject->property("property4") == metaObject->property(4) );
152- QVERIFY( metaObject->property("notProperty") == NULL );
153-
154- const StepCore::MetaProperty* property;
155-
156- /* QString property inherited from first base class */
157- property = testObject->metaObject()->property(0);
158- QCOMPARE( QString(property->name()), QString("name") );
159- QVERIFY( property->isReadable() );
160- QVERIFY( property->isWritable() );
161- QVERIFY( property->isStored() );
162-
163- QVERIFY( property->writeString(testObject, "test1") );
164- QCOMPARE( object->name(), QString("test1") );
165- QVERIFY( property->writeVariant(testObject, QVariant(QString("test2"))) );
166- QCOMPARE( object->name(), QString("test2") );
167-
168- QCOMPARE( property->readString(object), QString("test2") );
169- QCOMPARE( property->readVariant(object), QVariant(QString("test2")) );
170-
171- /* double property inherited from second base class */
172- property = testObject->metaObject()->property(1);
173- QCOMPARE( QString(property->name()), QString("property1") );
174-
175- QVERIFY( property->writeString(object, "1.1") );
176- QCOMPARE( testObject->property1(), 1.1 );
177- QVERIFY( property->writeVariant(object, QVariant(2.2)) );
178- QCOMPARE( testObject->property1(), 2.2 );
179- QCOMPARE( property->readString(object), QString("2.2") );
180- QCOMPARE( property->readVariant(object), QVariant(2.2) );
181-
182- QVERIFY( !property->writeString(object, "not number") );
183- QCOMPARE( testObject->property1(), 2.2 );
184- QVERIFY( !property->writeVariant(object, QVariant("not number")) );
185- QCOMPARE( testObject->property1(), 2.2 );
186-
187- /* double read-only property */
188- property = testObject->metaObject()->property(2);
189- QCOMPARE( QString(property->name()), QString("property2") );
190- QVERIFY( property->isReadable() );
191- QVERIFY( !property->isWritable() );
192- QVERIFY( !property->isStored() );
193-
194- QVERIFY( !property->writeString(object, "10") );
195- QCOMPARE( testObject->property2(), 2 );
196- QCOMPARE( property->readString(object), QString("2") );
197-
198- /* MetaObjectTestType property */
199- property = testObject->metaObject()->property(3);
200- QCOMPARE( QString(property->name()), QString("property3") );
201-
202- QVERIFY( property->writeString(object, "2") );
203- QCOMPARE( testObject->property3().value, 2 );
204- QVERIFY( property->writeVariant(object, 3) );
205- QCOMPARE( testObject->property3().value, 3 );
206-
207- QCOMPARE( property->readString(object), QString("3") );
208- QCOMPARE( property->readVariant(object).value<MetaObjectTestType>().value, 3 );
209-
210- /* CloneObject */
211- StepCore::Object* clone = object->metaObject()->cloneObject(*object);
212- QCOMPARE( clone->name(), object->name() );
213- QCOMPARE( dynamic_cast<MetaObjectTestObject*>(clone)->property1(),
214- dynamic_cast<MetaObjectTestObject*>(object)->property1());
215- QCOMPARE( dynamic_cast<MetaObjectTestObject*>(clone)->property2(),
216- dynamic_cast<MetaObjectTestObject*>(object)->property2());
217- QCOMPARE( dynamic_cast<MetaObjectTestObject*>(clone)->property3().value,
218- dynamic_cast<MetaObjectTestObject*>(object)->property3().value);
219- QCOMPARE( dynamic_cast<MetaObjectTestObject*>(clone)->property4().value,
220- dynamic_cast<MetaObjectTestObject*>(object)->property4().value);
221-
222- delete object;
223-}
224-
225-QTEST_MAIN(TestMetaobject)

Subscribers

People subscribed via source and target branches