summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorminiak <milan.burda@gmail.com>2009-07-01 09:50:29 (GMT)
committerMarius Storm-Olsen <marius@trolltech.com>2009-07-01 09:51:25 (GMT)
commitd2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db (patch)
tree946e359589d671f050c6a6a2f7f00b01e0ca6416 /tests/benchmarks
parentc447ce31632e25fdd40404cc96b6980aa0adcef8 (diff)
downloadQt-d2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db.zip
Qt-d2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db.tar.gz
Qt-d2f4a4b4f232b1c42cd89ac0b6bccb77dfe8e0db.tar.bz2
tests: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT support
Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qdiriterator/main.cpp2
-rw-r--r--tests/benchmarks/qdiriterator/qfilesystemiterator.cpp19
-rw-r--r--tests/benchmarks/qfile/main.cpp12
3 files changed, 11 insertions, 22 deletions
diff --git a/tests/benchmarks/qdiriterator/main.cpp b/tests/benchmarks/qdiriterator/main.cpp
index 13128f7..1a5ffbb 100644
--- a/tests/benchmarks/qdiriterator/main.cpp
+++ b/tests/benchmarks/qdiriterator/main.cpp
@@ -107,7 +107,7 @@ static int posix_helper(const wchar_t *dirpath)
wchar_t appendedPath[MAX_PATH];
wcscpy(appendedPath, dirpath);
wcscat(appendedPath, L"\\*");
- hSearch = FindFirstFileW(appendedPath, &fd);
+ hSearch = FindFirstFile(appendedPath, &fd);
appendedPath[origDirPathLength] = 0;
if (hSearch == INVALID_HANDLE_VALUE) {
diff --git a/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp
index 1ef600b..47720f1 100644
--- a/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp
+++ b/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp
@@ -108,17 +108,6 @@
QT_BEGIN_NAMESPACE
-#ifdef Q_OS_WIN
-inline QString convertString(TCHAR* sz)
-{
-#ifdef UNICODE
- return QString::fromUtf16(sz);
-#else
- return QString::fromLocal8Bit(sz);
-#endif
-}
-#endif
-
class QFileSystemIteratorPrivate
{
public:
@@ -202,7 +191,7 @@ QFileSystemIteratorPrivate::~QFileSystemIteratorPrivate()
}
#ifdef Q_OS_WIN
-static bool isDotOrDotDot(const TCHAR* name)
+static bool isDotOrDotDot(const wchar_t* name)
{
if (name[0] == L'.' && name[1] == 0)
return true;
@@ -339,7 +328,7 @@ bool QFileSystemIteratorPrivate::advanceHelper()
if (m_entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
QByteArray ba = m_dirPaths.top();
ba += '\\';
- ba += convertString(m_entry->cFileName);
+ ba += QString::fromWCharArray(m_entry->cFileName);
pushSubDirectory(ba);
}
#else
@@ -634,7 +623,7 @@ QString QFileSystemIterator::fileName() const
if (d->m_currentDirShown == QFileSystemIteratorPrivate::ShowDotDotDir)
return QLatin1String("@@");
#ifdef Q_OS_WIN
- return convertString(d->m_entry->cFileName);
+ return QString::fromWCharArray(d->m_entry->cFileName);
#else
return QString::fromLocal8Bit(d->m_entry->d_name);
#endif
@@ -659,7 +648,7 @@ QString QFileSystemIterator::filePath() const
else if (d->m_entry) {
ba += '/';
#ifdef Q_OS_WIN
- ba += convertString(d->m_entry->cFileName);
+ ba += QString::fromWCharArray(d->m_entry->cFileName);
#else
ba += d->m_entry->d_name;
#endif
diff --git a/tests/benchmarks/qfile/main.cpp b/tests/benchmarks/qfile/main.cpp
index 2fa425d..5360eb5 100644
--- a/tests/benchmarks/qfile/main.cpp
+++ b/tests/benchmarks/qfile/main.cpp
@@ -275,11 +275,11 @@ void tst_qfile::readBigFile()
HANDLE hndl;
// ensure we don't account string conversion
- TCHAR* cfilename = (TCHAR*)filename.utf16();
+ wchar_t* cfilename = (wchar_t*)filename.utf16();
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
Q_ASSERT(hndl);
- TCHAR* nativeBuffer = new TCHAR[BUFSIZE];
+ wchar_t* nativeBuffer = new wchar_t[BUFSIZE];
DWORD numberOfBytesRead;
QBENCHMARK {
@@ -358,7 +358,7 @@ void tst_qfile::seek()
HANDLE hndl;
// ensure we don't account string conversion
- TCHAR* cfilename = (TCHAR*)filename.utf16();
+ wchar_t* cfilename = (wchar_t*)filename.utf16();
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
Q_ASSERT(hndl);
@@ -441,7 +441,7 @@ void tst_qfile::open()
HANDLE hndl;
// ensure we don't account string conversion
- TCHAR* cfilename = (TCHAR*)filename.utf16();
+ wchar_t* cfilename = (wchar_t*)filename.utf16();
QBENCHMARK {
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
@@ -620,11 +620,11 @@ void tst_qfile::readSmallFiles()
HANDLE hndl;
// ensure we don't account string conversion
- TCHAR* cfilename = (TCHAR*)filename.utf16();
+ wchar_t* cfilename = (wchar_t*)filename.utf16();
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
Q_ASSERT(hndl);
- TCHAR* nativeBuffer = new TCHAR[BUFSIZE];
+ wchar_t* nativeBuffer = new wchar_t[BUFSIZE];
DWORD numberOfBytesRead;
QBENCHMARK {
do {