diff options
author | Harald Fernengel <harald@trolltech.com> | 2009-08-11 09:02:26 (GMT) |
---|---|---|
committer | Harald Fernengel <harald@trolltech.com> | 2009-08-11 09:02:38 (GMT) |
commit | dce17b9375c1fce6cb5b94554f4aaa3fc4c42f7b (patch) | |
tree | 0f78ec800f0d02efb0e6a4239b896dc435a40aeb /tests/auto/qscopedpointer/tst_qscopedpointer.cpp | |
parent | 731c7be94590f0bee1c02a95273732e14543b175 (diff) | |
download | Qt-dce17b9375c1fce6cb5b94554f4aaa3fc4c42f7b.zip Qt-dce17b9375c1fce6cb5b94554f4aaa3fc4c42f7b.tar.gz Qt-dce17b9375c1fce6cb5b94554f4aaa3fc4c42f7b.tar.bz2 |
test slots are not const
Diffstat (limited to 'tests/auto/qscopedpointer/tst_qscopedpointer.cpp')
-rw-r--r-- | tests/auto/qscopedpointer/tst_qscopedpointer.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp index b8e0f0a..7f571a9 100644 --- a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp +++ b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp @@ -54,35 +54,35 @@ class tst_QScopedPointer : public QObject Q_OBJECT private Q_SLOTS: - void defaultConstructor() const; - void dataOnDefaultConstructed() const; - void useSubClassInConstructor() const; - void dataOnValue() const; - void dataSignature() const; - void reset() const; - void dereferenceOperator() const; - void dereferenceOperatorSignature() const; - void pointerOperator() const; - void pointerOperatorSignature() const; - void negationOperator() const; - void negationOperatorSignature() const; - void operatorBool() const; - void operatorBoolSignature() const; - void isNull() const; - void isNullSignature() const; - void objectSize() const; - void comparison() const; - // TODO instansiate on const object + void defaultConstructor(); + void dataOnDefaultConstructed(); + void useSubClassInConstructor(); + void dataOnValue(); + void dataSignature(); + void reset(); + void dereferenceOperator(); + void dereferenceOperatorSignature(); + void pointerOperator(); + void pointerOperatorSignature(); + void negationOperator(); + void negationOperatorSignature(); + void operatorBool(); + void operatorBoolSignature(); + void isNull(); + void isNullSignature(); + void objectSize(); + void comparison(); + // TODO instanciate on const object }; -void tst_QScopedPointer::defaultConstructor() const +void tst_QScopedPointer::defaultConstructor() { /* Check that the members, one, is correctly initialized. */ QScopedPointer<int> p; QCOMPARE(p.data(), static_cast<int *>(0)); } -void tst_QScopedPointer::dataOnDefaultConstructed() const +void tst_QScopedPointer::dataOnDefaultConstructed() { QScopedPointer<int> p; @@ -97,13 +97,13 @@ class MySubClass : public MyClass { }; -void tst_QScopedPointer::useSubClassInConstructor() const +void tst_QScopedPointer::useSubClassInConstructor() { /* Use a syntax which users typically would do. */ QScopedPointer<MyClass> p(new MyClass()); } -void tst_QScopedPointer::dataOnValue() const +void tst_QScopedPointer::dataOnValue() { int *const rawPointer = new int(5); QScopedPointer<int> p(rawPointer); @@ -111,14 +111,14 @@ void tst_QScopedPointer::dataOnValue() const QCOMPARE(p.data(), rawPointer); } -void tst_QScopedPointer::dataSignature() const +void tst_QScopedPointer::dataSignature() { const QScopedPointer<int> p; /* data() should be const. */ p.data(); } -void tst_QScopedPointer::reset() const +void tst_QScopedPointer::reset() { /* Call reset() on a default constructed value. */ { @@ -172,7 +172,7 @@ public: } }; -void tst_QScopedPointer::dereferenceOperator() const +void tst_QScopedPointer::dereferenceOperator() { /* Dereference a basic value. */ { @@ -192,7 +192,7 @@ void tst_QScopedPointer::dereferenceOperator() const } } -void tst_QScopedPointer::dereferenceOperatorSignature() const +void tst_QScopedPointer::dereferenceOperatorSignature() { /* The operator should be const. */ { @@ -219,7 +219,7 @@ public: int value; }; -void tst_QScopedPointer::pointerOperator() const +void tst_QScopedPointer::pointerOperator() { QScopedPointer<AnyForm> p(new AnyForm()); p->value = 5; @@ -227,7 +227,7 @@ void tst_QScopedPointer::pointerOperator() const QCOMPARE(p->value, 5); } -void tst_QScopedPointer::pointerOperatorSignature() const +void tst_QScopedPointer::pointerOperatorSignature() { /* The operator should be const. */ const QScopedPointer<AnyForm> p(new AnyForm); @@ -236,7 +236,7 @@ void tst_QScopedPointer::pointerOperatorSignature() const QVERIFY(p->value); } -void tst_QScopedPointer::negationOperator() const +void tst_QScopedPointer::negationOperator() { /* Invoke on default constructed value. */ { @@ -251,7 +251,7 @@ void tst_QScopedPointer::negationOperator() const } } -void tst_QScopedPointer::negationOperatorSignature() const +void tst_QScopedPointer::negationOperatorSignature() { /* The signature should be const. */ const QScopedPointer<int> p; @@ -261,7 +261,7 @@ void tst_QScopedPointer::negationOperatorSignature() const static_cast<bool>(!p); } -void tst_QScopedPointer::operatorBool() const +void tst_QScopedPointer::operatorBool() { /* Invoke on default constructed value. */ { @@ -276,15 +276,15 @@ void tst_QScopedPointer::operatorBool() const } } -void tst_QScopedPointer::operatorBoolSignature() const +void tst_QScopedPointer::operatorBoolSignature() { /* The signature should be const and return bool. */ const QScopedPointer<int> p; - static_cast<bool>(p); + (void)static_cast<bool>(p); } -void tst_QScopedPointer::isNull() const +void tst_QScopedPointer::isNull() { /* Invoke on default constructed value. */ { @@ -299,7 +299,7 @@ void tst_QScopedPointer::isNull() const } } -void tst_QScopedPointer::isNullSignature() const +void tst_QScopedPointer::isNullSignature() { const QScopedPointer<int> p(new int(69)); @@ -307,13 +307,13 @@ void tst_QScopedPointer::isNullSignature() const static_cast<bool>(p.isNull()); } -void tst_QScopedPointer::objectSize() const +void tst_QScopedPointer::objectSize() { /* The size of QScopedPointer should be the same as one pointer. */ QCOMPARE(sizeof(QScopedPointer<int>), sizeof(void *)); } -void tst_QScopedPointer::comparison() const +void tst_QScopedPointer::comparison() { int *a = new int(42); int *b = new int(43); |