diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-10-09 10:03:42 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-10-09 10:04:00 (GMT) |
commit | 606e1150e381e0d824e6850befb101a2ed8e0542 (patch) | |
tree | 10a180b6e8013a22e7937f9c78d9636573d7ec83 /tests/auto/qnetworkrequest | |
parent | 62e7e63779a8dbd5dec16e5eb938bf597bc22548 (diff) | |
download | Qt-606e1150e381e0d824e6850befb101a2ed8e0542.zip Qt-606e1150e381e0d824e6850befb101a2ed8e0542.tar.gz Qt-606e1150e381e0d824e6850befb101a2ed8e0542.tar.bz2 |
Add a way to allow tracking the originating object with QNetworkRequest.
Added setOriginatingObject() and originatingObject() to QNetworkRequest
that internally tracks the QObject using a QWeakPointer.
Reviewed-by: Lars Knoll
Rubberstamped-by: Thiago
Diffstat (limited to 'tests/auto/qnetworkrequest')
-rw-r--r-- | tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp b/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp index 3f9632c..2e21087 100644 --- a/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp +++ b/tests/auto/qnetworkrequest/tst_qnetworkrequest.cpp @@ -66,6 +66,7 @@ private slots: void setHeader(); void rawHeaderParsing_data(); void rawHeaderParsing(); + void originatingObject(); void removeHeader(); }; @@ -476,5 +477,20 @@ void tst_QNetworkRequest::removeHeader() QVERIFY(request.hasRawHeader("bar")); } +void tst_QNetworkRequest::originatingObject() +{ + QNetworkRequest request; + + QVERIFY(!request.originatingObject()); + + { + QObject dummy; + request.setOriginatingObject(&dummy); + QCOMPARE(request.originatingObject(), &dummy); + } + + QVERIFY(!request.originatingObject()); +} + QTEST_MAIN(tst_QNetworkRequest) #include "tst_qnetworkrequest.moc" |