summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_qset.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-08-11 13:49:37 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-08-26 12:06:42 (GMT)
commitdcee6e1371d899eb79717b8e3f3eec08b765db82 (patch)
treef34d4d7d6a05fb1939fbcb5d707496fdea095b38 /doc/src/snippets/code/doc_src_qset.cpp
parent7b693627ee2a17718cb6d8bee5e3deb5a97b307f (diff)
downloadQt-dcee6e1371d899eb79717b8e3f3eec08b765db82.zip
Qt-dcee6e1371d899eb79717b8e3f3eec08b765db82.tar.gz
Qt-dcee6e1371d899eb79717b8e3f3eec08b765db82.tar.bz2
Fix QDir::operator==(const QDir &) const
We can't rely on absolute paths when comparing directories for equality as these don't take into account symbolic links and may also bypass ../ and ./ simplification. Instead, canonical paths must be computed and can then be compared according to the case sensitivity rules for the platform or file engine, as is done in QFileInfo. Task-number: QTBUG-20495 Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'doc/src/snippets/code/doc_src_qset.cpp')
0 files changed, 0 insertions, 0 deletions
the ** distribution. ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor ** the names of its contributors may be used to endorse or promote ** products derived from this software without specific prior written ** permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** $QT_END_LICENSE$ ** ****************************************************************************/ //! [0] class MyFirstTest: public QObject { Q_OBJECT private slots: void initTestCase() { qDebug("called before everything else"); } void myFirstTest() { QVERIFY(1 == 1); } void mySecondTest() { QVERIFY(1 != 2); } void cleanupTestCase() { qDebug("called after myFirstTest and mySecondTest"); } }; //! [0] //! [8] void TestQString::toUpper() { QString str = "Hello"; QVERIFY(str.toUpper() == "HELLO"); } //! [8] //! [11] QCOMPARE(QString("hello").toUpper(), QString("HELLO")); QCOMPARE(QString("Hello").toUpper(), QString("HELLO")); QCOMPARE(QString("HellO").toUpper(), QString("HELLO")); QCOMPARE(QString("HELLO").toUpper(), QString("HELLO")); //! [11] //! [12] class MyFirstBenchmark: public QObject { Q_OBJECT private slots: void myFirstBenchmark() { QString string1; QString string2; QBENCHMARK { string1.localeAwareCompare(string2); } } }; //! [12]