diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-11-23 11:26:54 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-11-23 11:26:54 (GMT) |
commit | 802498fcd43558a10bb7477d3957cdd27fd8ec09 (patch) | |
tree | c40ddd859b032ffa7ed9c6df1173312c0bb1947d /tests/auto/qalgorithms/tst_qalgorithms.cpp | |
parent | 901fee7e610ec53f744416aeeca89c4605923120 (diff) | |
parent | 538e7b8ddf45936bb274ed3230b591b3459edfa7 (diff) | |
download | Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.zip Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.tar.gz Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.tar.bz2 |
Merge remote branch 'qt/master' into file-engine-refactor
Conflicts:
demos/declarative/minehunt/minehunt.pro
src/corelib/io/io.pri
src/corelib/io/qfsfileengine.cpp
src/corelib/io/qfsfileengine_unix.cpp
src/corelib/io/qfsfileengine_win.cpp
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtDeclarativeu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtDeclarativeu.def
src/s60installs/eabi/QtGuiu.def
tests/auto/qapplication/test/test.pro
tests/auto/qaudioinput/qaudioinput.pro
tests/auto/qaudiooutput/qaudiooutput.pro
tests/auto/qchar/qchar.pro
tests/auto/qdiriterator/qdiriterator.pro
tests/auto/qsound/qsound.pro
Diffstat (limited to 'tests/auto/qalgorithms/tst_qalgorithms.cpp')
-rw-r--r-- | tests/auto/qalgorithms/tst_qalgorithms.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qalgorithms/tst_qalgorithms.cpp b/tests/auto/qalgorithms/tst_qalgorithms.cpp index 690bbbd..17e6c04 100644 --- a/tests/auto/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/qalgorithms/tst_qalgorithms.cpp @@ -81,6 +81,7 @@ private slots: void test_qBinaryFind(); void qBinaryFindOneEntry(); void swap(); + void swap2(); void sortEmptyList(); void sortedList(); void sortAPItest(); @@ -521,6 +522,28 @@ void tst_QAlgorithms::swap() } } +namespace SwapTest { + struct ST { int i; int j; }; + void swap(ST &a, ST &b) { + a.i = b.j; + b.i = a.j; + } +} + +void tst_QAlgorithms::swap2() +{ + { +#ifndef QT_NO_SQL + //check the namespace lookup works correctly + SwapTest::ST a = { 45, 65 }; + SwapTest::ST b = { 48, 68 }; + qSwap(a, b); + QCOMPARE(a.i, 68); + QCOMPARE(b.i, 65); +#endif + } +} + void tst_QAlgorithms::sortEmptyList() { // Only test if it crashes |