summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp21
-rw-r--r--tests/auto/qkeysequence/qkeysequence.pro4
-rw-r--r--tests/auto/qkeysequence/qkeysequence.qrc6
-rw-r--r--tests/auto/qkeysequence/qt_de.qmbin0 -> 186240 bytes
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp4
-rw-r--r--tests/auto/qthread/tst_qthread.cpp27
-rw-r--r--tests/auto/qtwidgets/tst_qtwidgets.cpp2
7 files changed, 40 insertions, 24 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 8d5cd34..fdc9c86 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -642,7 +642,7 @@ void tst_QImageReader::imageFormatBeforeRead()
void tst_QImageReader::gifHandlerBugs()
{
{
- QImageReader io("images/trolltech.gif");
+ QImageReader io(":images/trolltech.gif");
QVERIFY(io.loopCount() != 1);
int count=0;
for (; io.canRead(); io.read(), ++count) ;
@@ -651,8 +651,8 @@ void tst_QImageReader::gifHandlerBugs()
// Task 95166
{
- QImageReader io1("images/bat1.gif");
- QImageReader io2("images/bat2.gif");
+ QImageReader io1(":images/bat1.gif");
+ QImageReader io2(":images/bat2.gif");
QVERIFY(io1.canRead());
QVERIFY(io2.canRead());
QImage im1 = io1.read();
@@ -664,8 +664,8 @@ void tst_QImageReader::gifHandlerBugs()
// Task 9994
{
- QImageReader io1("images/noclearcode.gif");
- QImageReader io2("images/noclearcode.bmp");
+ QImageReader io1(":images/noclearcode.gif");
+ QImageReader io2(":images/noclearcode.bmp");
QVERIFY(io1.canRead()); QVERIFY(io2.canRead());
QImage im1 = io1.read(); QImage im2 = io2.read();
QVERIFY(!im1.isNull()); QVERIFY(!im2.isNull());
@@ -675,13 +675,14 @@ void tst_QImageReader::gifHandlerBugs()
void tst_QImageReader::animatedGif()
{
- QImageReader io(prefix + "qt.gif");
- QImage image= io.read();
- int i=0;
+ QImageReader io(":images/qt.gif");
+ QImage image = io.read();
+ QVERIFY(!image.isNull());
+ int i = 0;
while(!image.isNull()){
- QString frameName = QString(prefix + "qt%1.gif").arg(++i);
+ QString frameName = QString(":images/qt%1.gif").arg(++i);
QCOMPARE(image, QImage(frameName));
- image=io.read();
+ image = io.read();
}
}
#endif
diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro
index 6566340..bd85402 100644
--- a/tests/auto/qkeysequence/qkeysequence.pro
+++ b/tests/auto/qkeysequence/qkeysequence.pro
@@ -1,6 +1,4 @@
load(qttest_p4)
SOURCES += tst_qkeysequence.cpp
-TRANSLATIONS += keys_de.ts
-
-
+RESOURCES += qkeysequence.qrc \ No newline at end of file
diff --git a/tests/auto/qkeysequence/qkeysequence.qrc b/tests/auto/qkeysequence/qkeysequence.qrc
new file mode 100644
index 0000000..e224faa
--- /dev/null
+++ b/tests/auto/qkeysequence/qkeysequence.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource>
+ <file>keys_de.qm</file>
+ <file>qt_de.qm</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/qkeysequence/qt_de.qm b/tests/auto/qkeysequence/qt_de.qm
new file mode 100644
index 0000000..595e4d7
--- /dev/null
+++ b/tests/auto/qkeysequence/qt_de.qm
Binary files differ
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index 9da0671..868f843 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -166,9 +166,9 @@ tst_QKeySequence::~tst_QKeySequence()
void tst_QKeySequence::initTestCase()
{
ourTranslator = new QTranslator(this);
- ourTranslator->load(QLatin1String("keys_de"), ".");
+ ourTranslator->load(":/keys_de");
qtTranslator = new QTranslator(this);
- qtTranslator->load(QLatin1String("qt_de"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+ qtTranslator->load(":/qt_de");
}
void tst_QKeySequence::operatorQString_data()
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp
index 34b74d8..587622e 100644
--- a/tests/auto/qthread/tst_qthread.cpp
+++ b/tests/auto/qthread/tst_qthread.cpp
@@ -629,6 +629,12 @@ void noop(void*) { }
typedef HANDLE ThreadHandle;
#endif
+#ifdef Q_OS_WIN
+#define WIN_FIX_STDCALL __stdcall
+#else
+#define WIN_FIX_STDCALL
+#endif
+
class NativeThreadWrapper
{
public:
@@ -639,7 +645,7 @@ public:
void setWaitForStop() { waitForStop = true; }
void stop();
- ThreadHandle nativeThread;
+ ThreadHandle nativeThreadHandle;
QThread *qthread;
QWaitCondition startCondition;
QMutex mutex;
@@ -647,7 +653,7 @@ public:
QWaitCondition stopCondition;
protected:
static void *runUnix(void *data);
- static void runWin(void *data);
+ static unsigned WIN_FIX_STDCALL runWin(void *data);
FunctionPointer functionPointer;
void *data;
@@ -658,12 +664,13 @@ void NativeThreadWrapper::start(FunctionPointer functionPointer, void *data)
this->functionPointer = functionPointer;
this->data = data;
#ifdef Q_OS_UNIX
- const int state = pthread_create(&nativeThread, 0, NativeThreadWrapper::runUnix, this);
+ const int state = pthread_create(&nativeThreadHandle, 0, NativeThreadWrapper::runUnix, this);
Q_UNUSED(state);
#elif defined(Q_OS_WINCE)
- nativeThread = CreateThread(NULL, 0 , (LPTHREAD_START_ROUTINE)NativeThreadWrapper::runWin , this, 0, NULL);
+ nativeThreadHandle = CreateThread(NULL, 0 , (LPTHREAD_START_ROUTINE)NativeThreadWrapper::runWin , this, 0, NULL);
#elif defined Q_OS_WIN
- nativeThread = (HANDLE)_beginthread(NativeThreadWrapper::runWin, 0, this);
+ unsigned thrdid = 0;
+ nativeThreadHandle = (Qt::HANDLE) _beginthreadex(NULL, 0, NativeThreadWrapper::runWin, this, 0, &thrdid);
#endif
}
@@ -677,9 +684,10 @@ void NativeThreadWrapper::startAndWait(FunctionPointer functionPointer, void *da
void NativeThreadWrapper::join()
{
#ifdef Q_OS_UNIX
- pthread_join(nativeThread, 0);
+ pthread_join(nativeThreadHandle, 0);
#elif defined Q_OS_WIN
- WaitForSingleObject(nativeThread, INFINITE);
+ WaitForSingleObject(nativeThreadHandle, INFINITE);
+ CloseHandle(nativeThreadHandle);
#endif
}
@@ -687,7 +695,7 @@ void *NativeThreadWrapper::runUnix(void *that)
{
NativeThreadWrapper *nativeThreadWrapper = reinterpret_cast<NativeThreadWrapper*>(that);
- // Adoppt thread, create QThread object.
+ // Adopt thread, create QThread object.
nativeThreadWrapper->qthread = QThread::currentThread();
// Release main thread.
@@ -709,9 +717,10 @@ void *NativeThreadWrapper::runUnix(void *that)
return 0;
}
-void NativeThreadWrapper::runWin(void *data)
+unsigned WIN_FIX_STDCALL NativeThreadWrapper::runWin(void *data)
{
runUnix(data);
+ return 0;
}
void NativeThreadWrapper::stop()
diff --git a/tests/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp
index f5f638e..237c3f3 100644
--- a/tests/auto/qtwidgets/tst_qtwidgets.cpp
+++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp
@@ -59,6 +59,8 @@ private slots:
void tst_QtWidgets::snapshot()
{
+ QSKIP("This test doesn't do anything useful at the moment.", SkipAll);
+
StyleWidget widget(0, Qt::X11BypassWindowManagerHint);
widget.show();