From a30aa66726c1992a0b21b3663b8080661d899e13 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 25 Nov 2009 12:33:34 +0100 Subject: Test for the clipboard presence in autotest --- tests/auto/qlineedit/tst_qlineedit.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index dd5bb29..79d1b3a 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -1415,8 +1415,22 @@ void tst_QLineEdit::undo_keypressevents() } #ifndef QT_NO_CLIPBOARD +static bool nativeClipboardWorking() +{ +#ifdef Q_WS_MAC + PasteboardRef pasteboard; + OSStatus status = PasteboardCreate(0, &pasteboard); + if (status == noErr) + CFRelease(pasteboard); + return status == noErr; +#endif + return true; +} + void tst_QLineEdit::QTBUG5786_undoPaste() { + if (!nativeClipboardWorking()) + QSKIP("this machine doesn't support the clipboard", SkipAll); QString initial("initial"); QString string("test"); QString additional("add"); -- cgit v0.12