Remove DEPENDS_ON from qtestlib API.

The DEPENDS_ON macro didn't do anything and has misled many users to
think that they can write test functions that depend on other test
functions.

Task-number: QTBUG-21851
Change-Id: Ibe65b2d5d88bb81b6a0ebbe0b220f7d409a1446c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2011-10-18 12:50:36 +10:00 committed by Qt by Nokia
parent ae1810658b
commit 8f02339e76
21 changed files with 3 additions and 655 deletions

View File

@ -128,8 +128,6 @@ do {\
#define QFETCH_GLOBAL(type, name)\
type name = *static_cast<type *>(QTest::qGlobalData(#name, ::qMetaTypeId<type >()))
#define DEPENDS_ON(funcName)
#define QTEST(actual, testElement)\
do {\
if (!QTest::qTest(actual, testElement, #actual, #testElement, __FILE__, __LINE__))\

View File

@ -77,11 +77,9 @@ private slots:
#ifndef QT_NO_EXCEPTIONS
void exceptions();
#endif
void maxThreadCount();
void setMaxThreadCount_data();
void setMaxThreadCount();
void setMaxThreadCountStartsAndStopsThreads();
void activeThreadCount();
void reserveThread_data();
void reserveThread();
void releaseThread_data();
@ -368,11 +366,6 @@ void tst_QThreadPool::exceptions()
}
#endif
void tst_QThreadPool::maxThreadCount()
{
DEPENDS_ON("setMaxThreadCount()");
}
void tst_QThreadPool::setMaxThreadCount_data()
{
QTest::addColumn<int>("limit");
@ -490,14 +483,6 @@ void tst_QThreadPool::setMaxThreadCountStartsAndStopsThreads()
// delete task;
}
void tst_QThreadPool::activeThreadCount()
{
DEPENDS_ON("tryReserveThread()");
DEPENDS_ON("reserveThread()");
DEPENDS_ON("releaseThread()");
}
void tst_QThreadPool::reserveThread_data()
{
setMaxThreadCount_data();

View File

@ -651,8 +651,6 @@ void tst_QFile::seek()
void tst_QFile::setSize()
{
DEPENDS_ON( "size" );
if ( QFile::exists( "createme.txt" ) )
QFile::remove( "createme.txt" );
QVERIFY( !QFile::exists( "createme.txt" ) );
@ -1120,8 +1118,6 @@ void tst_QFile::permissions()
void tst_QFile::setPermissions()
{
DEPENDS_ON( "permissions" ); //if that doesn't work...
if ( QFile::exists( "createme.txt" ) )
QFile::remove( "createme.txt" );
QVERIFY( !QFile::exists( "createme.txt" ) );

View File

@ -197,7 +197,6 @@ private slots:
void throwInExec();
#endif
void reexec();
void exit();
void execAfterExit();
void wakeUp();
void quit();
@ -398,9 +397,6 @@ void tst_QEventLoop::reexec()
QCOMPARE(loop.exec(), 0);
}
void tst_QEventLoop::exit()
{ DEPENDS_ON(exec()); }
void tst_QEventLoop::execAfterExit()
{
QEventLoop loop;

View File

@ -64,8 +64,6 @@ private slots:
void tryAcquireWithTimeout_data();
void tryAcquireWithTimeout();
void tryAcquireWithTimeoutStarvation();
void release();
void available();
void producerConsumer();
};
@ -363,12 +361,6 @@ void tst_QSemaphore::tryAcquireWithTimeoutStarvation()
QVERIFY(consumer.wait());
}
void tst_QSemaphore::release()
{ DEPENDS_ON("acquire"); }
void tst_QSemaphore::available()
{ DEPENDS_ON("acquire"); }
const char alphabet[] = "ACGTH";
const int AlphabetSize = sizeof(alphabet) - 1;

View File

@ -79,20 +79,15 @@ private slots:
void isFinished();
void isRunning();
void setPriority();
void priority();
void setStackSize();
void stackSize();
void exit();
void start();
void terminate();
void quit();
void wait();
void started();
void finished();
void terminated();
void run();
void exec();
void setTerminationEnabled();
void sleep();
void msleep();
void usleep();
@ -415,9 +410,6 @@ void tst_QThread::setPriority()
QCOMPARE(thread.priority(), QThread::InheritPriority);
}
void tst_QThread::priority()
{ DEPENDS_ON("setPriority"); }
void tst_QThread::setStackSize()
{
Simple_Thread thread;
@ -428,11 +420,6 @@ void tst_QThread::setStackSize()
QCOMPARE(thread.stackSize(), 0u);
}
void tst_QThread::stackSize()
{
DEPENDS_ON("setStackSize");
}
void tst_QThread::exit()
{
Exit_Thread thread;
@ -537,12 +524,6 @@ void tst_QThread::quit()
QCOMPARE(thread2.result, 0);
}
void tst_QThread::wait()
{
DEPENDS_ON("isRunning");
DEPENDS_ON("isFinished");
}
void tst_QThread::started()
{
SignalRecorder recorder;
@ -579,14 +560,8 @@ void tst_QThread::terminated()
QVERIFY(recorder.wasActivated());
}
void tst_QThread::run()
{ DEPENDS_ON("wait()"); }
void tst_QThread::exec()
{
DEPENDS_ON("exit()");
DEPENDS_ON("quit()");
class MultipleExecThread : public QThread
{
public:
@ -621,9 +596,6 @@ void tst_QThread::exec()
QCOMPARE(thread.res2, 2);
}
void tst_QThread::setTerminationEnabled()
{ DEPENDS_ON("terminate"); }
void tst_QThread::sleep()
{
Sleep_Thread thread;

View File

@ -126,8 +126,6 @@ private slots:
void setRight();
void setBottom_data();
void setBottom();
void setX();
void setY();
void newSetTopLeft_data();
void newSetTopLeft();
void newSetBottomRight_data();
@ -1503,16 +1501,6 @@ void tst_QRect::setBottom()
QCOMPARE( r, nr );
}
void tst_QRect::setX()
{
DEPENDS_ON( "setLeft" );
}
void tst_QRect::setY()
{
DEPENDS_ON( "setTop" );
}
void tst_QRect::newSetTopLeft_data()
{
QTest::addColumn<QRect>("r");

View File

@ -69,9 +69,6 @@ private slots:
void secsTo();
void setHMS_data();
void setHMS();
void msec();
void second();
void minute();
void hour_data();
void hour();
void isValid();
@ -307,21 +304,6 @@ void tst_QTime::hour()
QCOMPARE( t1.msec(), msec );
}
void tst_QTime::minute()
{
DEPENDS_ON( "hour" );
}
void tst_QTime::second()
{
DEPENDS_ON( "hour" );
}
void tst_QTime::msec()
{
DEPENDS_ON( "hour" );
}
void tst_QTime::setHMS_data()
{
QTest::addColumn<int>("hour");

View File

@ -75,45 +75,14 @@ private slots:
void globalColors_data();
void globalColors();
void alpha();
void setAlpha();
void red();
void green();
void blue();
void setRed();
void setGreen();
void setBlue();
void getRgb();
void setRgb();
void rgba();
void setRgba();
void rgb();
void hue();
void saturation();
void value();
void getHsv();
void setHsv();
void cyan();
void magenta();
void yellow();
void black();
void getCmyk();
void setCmyk();
void hueHsl();
void saturationHsl();
void lightness();
void getHsl();
void setHsl();
void toRgb_data();
@ -134,24 +103,15 @@ private slots:
void convertTo();
void fromRgb();
void fromHsv();
void fromCmyk();
void fromHsl();
void light();
void dark();
void assignmentOoperator();
void equalityOperator();
void specConstructor_data();
void specConstructor();
void achromaticHslHue();
#if defined(Q_WS_X11) && !defined(Q_OS_IRIX)
void allowX11ColorNames();
void setallowX11ColorNames();
#endif
};
@ -549,8 +509,6 @@ void tst_QColor::constructNamedColorWithSpace()
void tst_QColor::colorNames()
{
DEPENDS_ON("setNamedColor()");
QStringList all = QColor::colorNames();
QCOMPARE(all.size(), rgbTblSize);
for (int i = 0; i < all.size(); ++i)
@ -576,24 +534,6 @@ void tst_QColor::spec()
}
void tst_QColor::alpha()
{ DEPENDS_ON(setRgb()); }
void tst_QColor::red()
{ DEPENDS_ON(setRgb()); }
void tst_QColor::green()
{ DEPENDS_ON(setRgb()); }
void tst_QColor::blue()
{ DEPENDS_ON(setRgb()); }
void tst_QColor::getRgb()
{ DEPENDS_ON(setRgb()); }
void tst_QColor::setAlpha()
{ DEPENDS_ON(setRgb()); }
bool veryFuzzyCompare(double a, double b)
{
return qAbs(a - b) < 0.01;
@ -601,8 +541,6 @@ bool veryFuzzyCompare(double a, double b)
void tst_QColor::setRed()
{
DEPENDS_ON(setRgb());
QColor c = QColor(Qt::blue).toHsv();
c.setRed(127);
QCOMPARE(c.red(), 127);
@ -618,8 +556,6 @@ void tst_QColor::setRed()
void tst_QColor::setGreen()
{
DEPENDS_ON(setRgb());
QColor c = QColor(Qt::blue).toHsv();
c.setGreen(127);
QCOMPARE(c.red(), 0);
@ -635,8 +571,6 @@ void tst_QColor::setGreen()
void tst_QColor::setBlue()
{
DEPENDS_ON(setRgb());
QColor c = QColor(Qt::red).toHsv();
c.setBlue(127);
QCOMPARE(c.red(), 255);
@ -790,9 +724,6 @@ void tst_QColor::setRgb()
}
}
void tst_QColor::rgba()
{ DEPENDS_ON("setRgba()"); }
void tst_QColor::setRgba()
{
for (int a = 0; a < 255; ++a) {
@ -806,21 +737,6 @@ void tst_QColor::setRgba()
}
}
void tst_QColor::rgb()
{ DEPENDS_ON(setRgb()); }
void tst_QColor::hue()
{ DEPENDS_ON(setHsv()); }
void tst_QColor::saturation()
{ DEPENDS_ON(setHsv()); }
void tst_QColor::value()
{ DEPENDS_ON(setHsv()); }
void tst_QColor::getHsv()
{ DEPENDS_ON(setHsv()); }
void tst_QColor::setHsv()
{
QColor color;
@ -922,21 +838,6 @@ void tst_QColor::setHsv()
}
}
void tst_QColor::cyan()
{ DEPENDS_ON(setCmyk()); }
void tst_QColor::magenta()
{ DEPENDS_ON(setCmyk()); }
void tst_QColor::yellow()
{ DEPENDS_ON(setCmyk()); }
void tst_QColor::black()
{ DEPENDS_ON(setCmyk()); }
void tst_QColor::getCmyk()
{ DEPENDS_ON(setCmyk()); }
void tst_QColor::setCmyk()
{
QColor color;
@ -1062,18 +963,6 @@ void tst_QColor::setCmyk()
}
}
void tst_QColor::hueHsl()
{ DEPENDS_ON(setHsl()); }
void tst_QColor::saturationHsl()
{ DEPENDS_ON(setHsl()); }
void tst_QColor::lightness()
{ DEPENDS_ON(setHsl()); }
void tst_QColor::getHsl()
{ DEPENDS_ON(setHsl()); }
void tst_QColor::setHsl()
{
QColor color;
@ -1403,25 +1292,8 @@ void tst_QColor::convertTo()
QColor invalid = color.convertTo(QColor::Invalid);
QVERIFY(invalid.spec() == QColor::Invalid);
DEPENDS_ON(toRgb());
DEPENDS_ON(toHsv());
DEPENDS_ON(toCmyk());
DEPENDS_ON(toHsl());
}
void tst_QColor::fromRgb()
{ DEPENDS_ON(convertTo()); }
void tst_QColor::fromHsv()
{ DEPENDS_ON(convertTo()); }
void tst_QColor::fromCmyk()
{ DEPENDS_ON(convertTo()); }
void tst_QColor::fromHsl()
{ DEPENDS_ON(convertTo()); }
void tst_QColor::light()
{
QColor gray(Qt::gray);
@ -1436,12 +1308,6 @@ void tst_QColor::dark()
QVERIFY(darker.value() < gray.value());
}
void tst_QColor::assignmentOoperator()
{ DEPENDS_ON(convertTo()); }
void tst_QColor::equalityOperator()
{ DEPENDS_ON(convertTo()); }
Q_DECLARE_METATYPE(QColor::Spec);
void tst_QColor::specConstructor_data()
@ -1471,11 +1337,6 @@ void tst_QColor::achromaticHslHue()
// This test fails on IRIX due to the gamma settings in the SGI X server.
#if defined(Q_WS_X11) && !defined(Q_OS_IRIX)
void tst_QColor::allowX11ColorNames()
{
DEPENDS_ON(setallowX11ColorNames());
}
void tst_QColor::setallowX11ColorNames()
{
RGBData x11RgbTbl[] = {

View File

@ -96,11 +96,9 @@ private slots:
void get();
void put_data();
void put();
void remove();
void mkdir_data();
void mkdir();
void mkdir2();
void rmdir();
void rename_data();
void rename();
@ -857,11 +855,6 @@ void tst_QFtp::put()
QVERIFY( !fileExists( host, port, user, password, file ) );
}
void tst_QFtp::remove()
{
DEPENDS_ON( "put" );
}
void tst_QFtp::mkdir_data()
{
QTest::addColumn<QString>("host");
@ -1009,11 +1002,6 @@ void tst_QFtp::mkdir2Slot(int id, bool)
ftp->mkdir("kake/test");
}
void tst_QFtp::rmdir()
{
DEPENDS_ON( "mkdir" );
}
void tst_QFtp::rename_data()
{
QTest::addColumn<QString>("host");

View File

@ -78,32 +78,18 @@ private slots:
void pressed();
void released();
void text();
void setText();
void icon();
void setIcon();
void shortcut();
void setShortcut();
void animateClick();
void isCheckable();
void isDown();
void setDown();
void isChecked();
void autoRepeat();
void toggle();
void clicked();
void toggled();
void isEnabled();
void setEnabled();
/*
void state();
void group();
void stateChanged();
*/
void shortcutEvents();
void stopRepeatTimer();
@ -246,11 +232,6 @@ void tst_QAbstractButton::onReleased()
release_count++;
}
void tst_QAbstractButton::autoRepeat()
{
DEPENDS_ON(" setAutoRepeat" );
}
void tst_QAbstractButton::setAutoRepeat_data()
{
QTest::addColumn<int>("mode");
@ -401,11 +382,6 @@ void tst_QAbstractButton::setText()
#endif
}
void tst_QAbstractButton::text()
{
DEPENDS_ON( "setText" );
}
void tst_QAbstractButton::setIcon()
{
const char *test1_xpm[] = {
@ -455,16 +431,6 @@ void tst_QAbstractButton::setIcon()
QCOMPARE( testWidget->width(), currentWidth );
}
void tst_QAbstractButton::icon()
{
DEPENDS_ON( "setIcon" );
}
void tst_QAbstractButton::isEnabled()
{
DEPENDS_ON( "setEnabled" );
}
void tst_QAbstractButton::setEnabled()
{
testWidget->setEnabled( FALSE );
@ -481,12 +447,6 @@ void tst_QAbstractButton::isCheckable()
QVERIFY( !testWidget->isCheckable() );
}
void tst_QAbstractButton::isDown()
{
DEPENDS_ON( "setDown" );
}
void tst_QAbstractButton::setDown()
{
testWidget->setDown( FALSE );
@ -523,11 +483,6 @@ void tst_QAbstractButton::isChecked()
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
void tst_QAbstractButton::toggle()
{
DEPENDS_ON( "toggled" );
}
void tst_QAbstractButton::toggled()
{
testWidget->toggle();
@ -541,11 +496,6 @@ void tst_QAbstractButton::toggled()
QVERIFY( click_count == 1 );
}
void tst_QAbstractButton::shortcut()
{
DEPENDS_ON( "setShortcut" );
}
void tst_QAbstractButton::setShortcut()
{
QKeySequence seq( Qt::Key_A );
@ -591,25 +541,6 @@ void tst_QAbstractButton::animateClick()
QVERIFY( !testWidget->isDown() );
}
void tst_QAbstractButton::clicked()
{
DEPENDS_ON( "toggled" );
}
/*
void tst_QAbstractButton::group()
{
}
void tst_QAbstractButton::state()
{
}
void tst_QAbstractButton::stateChanged()
{
}
*/
void tst_QAbstractButton::shortcutEvents()
{
MyButton button;

View File

@ -67,25 +67,15 @@ public slots:
void cleanup();
private slots:
void isChecked();
void setChecked();
void setNoChange();
void setTriState();
void isTriState();
void text();
void setText_data();
void setText();
void isToggleButton();
void setDown();
void isDown();
void isOn();
void checkState();
void autoRepeat();
void setAutoRepeat();
void toggle();
void pressed();
void released();
void clicked();
void toggled();
void stateChanged();
void foregroundRole();
@ -169,11 +159,6 @@ void tst_QCheckBox::onToggled( bool /*on*/ )
// ***************************************************
void tst_QCheckBox::isChecked()
{
DEPENDS_ON( "setChecked" );
}
void tst_QCheckBox::setChecked()
{
testWidget->setChecked( TRUE );
@ -227,21 +212,6 @@ void tst_QCheckBox::setTriState()
QVERIFY( testWidget->checkState() == Qt::Unchecked );
}
void tst_QCheckBox::isTriState()
{
DEPENDS_ON( "setTriState" );
}
void tst_QCheckBox::setNoChange()
{
DEPENDS_ON( "setTriState" );
}
void tst_QCheckBox::text()
{
DEPENDS_ON( "setText" );
}
void tst_QCheckBox::setText_data()
{
QTest::addColumn<QString>("s1");
@ -277,26 +247,6 @@ void tst_QCheckBox::setDown()
QVERIFY( !testWidget->isDown() );
}
void tst_QCheckBox::isDown()
{
DEPENDS_ON( "setDown" );
}
void tst_QCheckBox::isOn()
{
DEPENDS_ON( "setChecked" );
}
void tst_QCheckBox::checkState()
{
DEPENDS_ON( "setChecked" );
}
void tst_QCheckBox::autoRepeat()
{
DEPENDS_ON( "setAutoRepeat" );
}
void tst_QCheckBox::setAutoRepeat()
{
// setAutoRepeat has no effect on toggle buttons
@ -341,16 +291,6 @@ void tst_QCheckBox::pressed()
QVERIFY( testWidget->isChecked() );
}
void tst_QCheckBox::released()
{
DEPENDS_ON( "pressed" );
}
void tst_QCheckBox::clicked()
{
DEPENDS_ON( "pressed" );
}
void tst_QCheckBox::toggled()
{
connect(testWidget, SIGNAL(toggled(bool)), this, SLOT(onToggled(bool)));

View File

@ -73,17 +73,10 @@ public:
private slots:
void getSetCheck();
void widget();
void setWidget();
void setFeatures();
void features();
void setFloating();
void setAllowedAreas();
void allowedAreas();
void isAreaAllowed();
void toggleViewAction();
void featuresChanged();
void topLevelChanged();
void allowedAreasChanged();
void visibilityChanged();
void dockLocationChanged();
void setTitleBarWidget();
@ -217,12 +210,6 @@ void tst_QDockWidget::widget()
}
}
void tst_QDockWidget::setWidget()
{ DEPENDS_ON("setWidget()"); }
void tst_QDockWidget::setFeatures()
{ DEPENDS_ON("features()"); }
void tst_QDockWidget::features()
{
QDockWidget dw;
@ -394,9 +381,6 @@ void tst_QDockWidget::setFloating()
spy.clear();
}
void tst_QDockWidget::setAllowedAreas()
{ DEPENDS_ON("allowedAreas()"); }
void tst_QDockWidget::allowedAreas()
{
QDockWidget dw;
@ -517,9 +501,6 @@ void tst_QDockWidget::allowedAreas()
QCOMPARE(spy.count(), 0);
}
void tst_QDockWidget::isAreaAllowed()
{ DEPENDS_ON("allowedAreas()"); }
void tst_QDockWidget::toggleViewAction()
{
QMainWindow mw;
@ -671,15 +652,6 @@ void tst_QDockWidget::dockLocationChanged()
Qt::TopDockWidgetArea);
}
void tst_QDockWidget::featuresChanged()
{ DEPENDS_ON("features()"); }
void tst_QDockWidget::topLevelChanged()
{ DEPENDS_ON("setFloating()"); }
void tst_QDockWidget::allowedAreasChanged()
{ DEPENDS_ON("allowedAreas()"); }
void tst_QDockWidget::setTitleBarWidget()
{
//test the successive usage of setTitleBarWidget

View File

@ -87,16 +87,12 @@ public slots:
void cleanup();
private slots:
void getSetCheck();
void text();
void setText_data();
void setText();
void textFormat();
void setTextFormat();
void buddy();
#ifndef Q_WS_MAC
void setBuddy();
#endif
void setFont();
void setNum();
void clear();
void wordWrap();
@ -202,11 +198,6 @@ void tst_QLabel::cleanup()
}
}
void tst_QLabel::buddy()
{
DEPENDS_ON( "setBuddy" );
}
// Set buddy doesn't make much sense on Mac OS X.
#ifndef Q_WS_MAC
void tst_QLabel::setBuddy()
@ -233,11 +224,6 @@ void tst_QLabel::setBuddy()
}
#endif
void tst_QLabel::text()
{
DEPENDS_ON( "setText" );
}
void tst_QLabel::setText_data()
{
QTest::addColumn<QString>("txt");
@ -265,12 +251,6 @@ void tst_QLabel::setText()
QCOMPARE( testWidget->text(), txt );
}
void tst_QLabel::textFormat()
{
DEPENDS_ON( "setTextFormat" );
}
void tst_QLabel::setTextFormat()
{
// lets' start with the simple stuff...
@ -287,12 +267,6 @@ void tst_QLabel::setTextFormat()
QVERIFY( testWidget->textFormat() == Qt::AutoText );
}
void tst_QLabel::setFont()
{
DEPENDS_ON( "setText" );
}
void tst_QLabel::setNum()
{
testWidget->setText( "This is a text" );

View File

@ -151,11 +151,9 @@ private slots:
void redo_data();
void redo();
void isRedoAvailable();
void undo_data();
void undo();
void isUndoAvailable();
void undo_keypressevents_data();
void undo_keypressevents();
@ -176,8 +174,6 @@ private slots:
void displayText_data();
void displayText();
void setEchoMode();
void echoMode();
void passwordEchoOnEdit();
#ifdef QT_GUI_PASSWORD_ECHO_DELAY
@ -189,10 +185,8 @@ private slots:
void maxLength_data();
void maxLength();
void setMaxLength();
void isReadOnly();
void setReadOnly();
void cursorPosition();
@ -200,7 +194,6 @@ private slots:
void cursorPositionChanged();
void selectedText();
void hasSelectedText();
void deleteSelectedText();
void textChangedAndTextEdited();
@ -209,9 +202,6 @@ private slots:
void returnPressed_maskvalidator();
void setValidator();
void validator();
void clearValidator();
void setValidator_QIntValidator_data();
void setValidator_QIntValidator();
@ -222,11 +212,9 @@ private slots:
void setAlignment_data();
void setAlignment();
void alignment();
void isModified();
void edited();
void setEdited();
void insert();
void setSelection_data();
@ -234,8 +222,6 @@ private slots:
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
void paste();
#endif
void maxLengthAndInputMask();
void returnPressedKeyEvent();
@ -1110,11 +1096,6 @@ void tst_QLineEdit::undo()
#endif
}
void tst_QLineEdit::isUndoAvailable()
{
DEPENDS_ON("undo");
}
void tst_QLineEdit::redo_data()
{
QTest::addColumn<QStringList>("insertString");
@ -1192,11 +1173,6 @@ void tst_QLineEdit::redo()
#endif
}
void tst_QLineEdit::isRedoAvailable()
{
DEPENDS_ON("redo");
}
void tst_QLineEdit::undo_keypressevents_data()
{
QTest::addColumn<QTestEventList>("keys");
@ -1650,16 +1626,6 @@ void tst_QLineEdit::displayText()
QVERIFY(testWidget->echoMode() == mode);
}
void tst_QLineEdit::setEchoMode()
{
DEPENDS_ON("displayText");
}
void tst_QLineEdit::echoMode()
{
DEPENDS_ON("displayText");
}
void tst_QLineEdit::passwordEchoOnEdit()
{
QStyleOptionFrameV2 opt;
@ -1819,11 +1785,6 @@ void tst_QLineEdit::maxLength()
QCOMPARE(testWidget->text(), expectedString);
}
void tst_QLineEdit::setMaxLength()
{
DEPENDS_ON("maxLength");
}
void tst_QLineEdit::isReadOnly()
{
QVERIFY(!testWidget->isReadOnly());
@ -1851,11 +1812,6 @@ void tst_QLineEdit::isReadOnly()
QCOMPARE(testWidget->text(), QString("the quick dark brown fox"));
}
void tst_QLineEdit::setReadOnly()
{
DEPENDS_ON("isReadOnly");
}
static void figureOutProperKey(Qt::Key &key, Qt::KeyboardModifiers &pressState)
{
#ifdef Q_WS_MAC
@ -2169,11 +2125,6 @@ void tst_QLineEdit::onSelectionChanged()
selection_count++;
}
void tst_QLineEdit::hasSelectedText()
{
DEPENDS_ON("selectedText");
}
void tst_QLineEdit::deleteSelectedText()
{
const QString text = QString::fromLatin1("bar");
@ -2448,16 +2399,6 @@ void tst_QLineEdit::setValidator()
QVERIFY(testWidget->validator() == 0);
}
void tst_QLineEdit::validator()
{
DEPENDS_ON("setValidator");
}
void tst_QLineEdit::clearValidator()
{
DEPENDS_ON("setValidator");
}
void tst_QLineEdit::setValidator_QIntValidator_data()
{
QTest::addColumn<int>("mini");
@ -2646,11 +2587,6 @@ void tst_QLineEdit::frame()
QVERIFY(testWidget->hasFrame());
}
void tst_QLineEdit::alignment()
{
DEPENDS_ON("setAlignment");
}
void tst_QLineEdit::setAlignment_data()
{
#ifndef NO_PIXMAP_TESTS
@ -2771,15 +2707,6 @@ void tst_QLineEdit::edited()
QVERIFY(testWidget->isModified());
}
/*
Obsolete function but as long as we provide it, it needs to work.
*/
void tst_QLineEdit::setEdited()
{
DEPENDS_ON("edited");
}
void tst_QLineEdit::insert()
{
testWidget->insert("This");
@ -2937,17 +2864,8 @@ void tst_QLineEdit::cut()
testWidget->cut();
QCOMPARE(testWidget->text(), QString("Abcdefg defg hijklmno"));
}
void tst_QLineEdit::copy()
{
DEPENDS_ON("cut");
}
void tst_QLineEdit::paste()
{
DEPENDS_ON("cut");
}
#endif
class InputMaskValidator : public QValidator
{
public:

View File

@ -74,19 +74,13 @@ private slots:
void getSetCheck();
void constructor();
void iconSize();
void setIconSize();
void toolButtonStyle();
void setToolButtonStyle();
#ifndef Q_WS_WINCE_WM
void menuBar();
void setMenuBar();
#endif
void statusBar();
void setStatusBar();
void centralWidget();
void setCentralWidget();
void corner();
void setCorner();
void addToolBarBreak();
void insertToolBarBreak();
void addToolBar();
@ -97,12 +91,9 @@ private slots:
void splitDockWidget();
void removeDockWidget();
void dockWidgetArea();
void saveState();
void restoreState();
void restoreStateFromPreviousVersion();
void createPopupMenu();
void iconSizeChanged();
void toolButtonStyleChanged();
void hideBeforeLayout();
void saveRestore();
void saveRestore_data();
@ -343,10 +334,6 @@ void tst_QMainWindow::iconSize()
}
}
void tst_QMainWindow::setIconSize()
{ DEPENDS_ON("iconSize()");
}
void tst_QMainWindow::toolButtonStyle()
{
{
@ -543,9 +530,6 @@ void tst_QMainWindow::toolButtonStyle()
}
}
void tst_QMainWindow::setToolButtonStyle()
{ DEPENDS_ON("toolButtonStyle()"); }
// With native menubar integration on Windows Mobile the menubar is not a child
#ifndef Q_WS_WINCE_WM
void tst_QMainWindow::menuBar()
@ -631,9 +615,6 @@ void tst_QMainWindow::menuBar()
QVERIFY(!topRightCornerWidget);
}
}
void tst_QMainWindow::setMenuBar()
{ DEPENDS_ON("menuBar()"); }
#endif
void tst_QMainWindow::statusBar()
@ -718,9 +699,6 @@ void tst_QMainWindow::statusBar()
}
}
void tst_QMainWindow::setStatusBar()
{ DEPENDS_ON("statusBar()"); }
void tst_QMainWindow::centralWidget()
{
{
@ -787,9 +765,6 @@ void tst_QMainWindow::centralWidget()
}
}
void tst_QMainWindow::setCentralWidget()
{ DEPENDS_ON("centralwidget()"); }
void tst_QMainWindow::corner()
{
{
@ -826,9 +801,6 @@ void tst_QMainWindow::corner()
}
}
void tst_QMainWindow::setCorner()
{ DEPENDS_ON("corner()"); }
void tst_QMainWindow::addToolBarBreak()
{
{
@ -1227,9 +1199,6 @@ void tst_QMainWindow::dockWidgetArea()
}
}
void tst_QMainWindow::saveState()
{ DEPENDS_ON("restoreState()"); }
void tst_QMainWindow::restoreState()
{
QMainWindow mw;
@ -1615,12 +1584,6 @@ void tst_QMainWindow::saveRestore()
#endif
}
void tst_QMainWindow::iconSizeChanged()
{ DEPENDS_ON("iconSize()"); }
void tst_QMainWindow::toolButtonStyleChanged()
{ DEPENDS_ON("toolButtonStyle()"); }
void tst_QMainWindow::isSeparator()
{
QMainWindow mw;

View File

@ -340,7 +340,6 @@ void tst_QMenu::keyboardNavigation_data()
void tst_QMenu::keyboardNavigation()
{
DEPENDS_ON( "addActionsAndClear" ); //if add/clear fails...
QFETCH(int, key);
QFETCH(int, expected_action);
QFETCH(int, expected_menu);

View File

@ -74,23 +74,17 @@ public slots:
void cleanup();
private slots:
void getSetCheck();
void setAutoRepeat();
void autoRepeat();
void pressed();
void released();
void text();
void accel();
void setAccel();
void isCheckable();
void isDown();
void setDown();
void popupCrash();
void isChecked();
void autoRepeat();
void animateClick();
void toggle();
void clicked();
void toggled();
void isEnabled();
void defaultAndAutoDefault();
void sizeHint_data();
void sizeHint();
@ -204,7 +198,7 @@ void tst_QPushButton::onReleased()
release_count++;
}
void tst_QPushButton::setAutoRepeat()
void tst_QPushButton::autoRepeat()
{
// If this changes, this test must be completely revised.
QVERIFY( !testWidget->isCheckable() );
@ -283,11 +277,6 @@ void tst_QPushButton::setAutoRepeat()
QVERIFY( click_count == 0 );
}
void tst_QPushButton::autoRepeat()
{
DEPENDS_ON(" setAutoRepeat" );
}
void tst_QPushButton::pressed()
{
QTest::keyPress( testWidget, ' ' );
@ -314,31 +303,11 @@ void tst_QPushButton::pressed()
}
void tst_QPushButton::released()
{
DEPENDS_ON( "pressed" );
}
void tst_QPushButton::text()
{
DEPENDS_ON( "setText" );
}
void tst_QPushButton::isEnabled()
{
DEPENDS_ON( "setEnabled" );
}
void tst_QPushButton::isCheckable()
{
QVERIFY( !testWidget->isCheckable() );
}
void tst_QPushButton::isDown()
{
DEPENDS_ON( "setDown" );
}
void tst_QPushButton::setDown()
{
testWidget->setDown( FALSE );
@ -395,11 +364,6 @@ void tst_QPushButton::toggled()
QVERIFY( click_count == 1 );
}
void tst_QPushButton::accel()
{
DEPENDS_ON( "setAccel" );
}
/*
If we press an accelerator key we ONLY get a pressed signal and
NOT a released or clicked signal.

View File

@ -75,7 +75,6 @@ public slots:
void init();
private slots:
void getSetCheck();
void sizes(); // bare (as in empty)
void setSizes();
void setSizes_data();
void saveAndRestoreState();
@ -128,11 +127,6 @@ tst_QSplitter::~tst_QSplitter()
{
}
void tst_QSplitter::sizes()
{
DEPENDS_ON("setSizes");
}
void tst_QSplitter::initTestCase()
{
splitter = new QSplitter(Qt::Horizontal);

View File

@ -73,14 +73,9 @@ public slots:
void slot(QAction *action);
private slots:
void setMovable();
void isMovable();
void setAllowedAreas();
void allowedAreas();
void isAreaAllowed();
void setOrientation();
void orientation();
void clear();
void addAction();
void insertAction();
void addSeparator();
@ -88,18 +83,10 @@ private slots:
void addWidget();
void insertWidget();
void actionGeometry();
void actionAt();
void toggleViewAction();
void iconSize();
void setIconSize();
void toolButtonStyle();
void setToolButtonStyle();
void actionTriggered();
void movableChanged();
void allowedAreasChanged();
void orientationChanged();
void iconSizeChanged();
void toolButtonStyleChanged();
void visibilityChanged();
void actionOwnership();
void widgetAction();
@ -126,9 +113,6 @@ void tst_QToolBar::slot()
void tst_QToolBar::slot(QAction *action)
{ ::triggered = action; }
void tst_QToolBar::setMovable()
{ DEPENDS_ON("isMovable()"); }
void tst_QToolBar::isMovable()
{
#define DO_TEST \
@ -168,9 +152,6 @@ void tst_QToolBar::isMovable()
DO_TEST;
}
void tst_QToolBar::setAllowedAreas()
{ DEPENDS_ON("allowedAreas()"); }
void tst_QToolBar::allowedAreas()
{
QToolBar tb;
@ -291,12 +272,6 @@ void tst_QToolBar::allowedAreas()
QCOMPARE(spy.count(), 0);
}
void tst_QToolBar::isAreaAllowed()
{ DEPENDS_ON("allowedAreas()"); }
void tst_QToolBar::setOrientation()
{ DEPENDS_ON("orientation()"); }
void tst_QToolBar::orientation()
{
QToolBar tb;
@ -350,16 +325,6 @@ void tst_QToolBar::orientation()
QCOMPARE(spy.count(), 0);
}
void tst_QToolBar::clear()
{
DEPENDS_ON("addAction()");
DEPENDS_ON("insertAction()");
DEPENDS_ON("addSeparator()");
DEPENDS_ON("insertSeparator()");
DEPENDS_ON("addWidget()");
DEPENDS_ON("insertWidget()");
}
void tst_QToolBar::addAction()
{
QToolBar tb;
@ -635,9 +600,6 @@ void tst_QToolBar::actionGeometry()
QCOMPARE(tb.actionAt(rect4.center()), &action4);
}
void tst_QToolBar::actionAt()
{ DEPENDS_ON("actionGeometry()"); }
void tst_QToolBar::toggleViewAction()
{
{
@ -666,9 +628,6 @@ void tst_QToolBar::toggleViewAction()
}
}
void tst_QToolBar::setIconSize()
{ DEPENDS_ON("iconSize()"); }
void tst_QToolBar::iconSize()
{
{
@ -782,9 +741,6 @@ void tst_QToolBar::iconSize()
}
}
void tst_QToolBar::setToolButtonStyle()
{ DEPENDS_ON("toolButtonStyle()"); }
void tst_QToolBar::toolButtonStyle()
{
{
@ -982,21 +938,6 @@ void tst_QToolBar::actionTriggered()
QCOMPARE(::triggered, &action4);
}
void tst_QToolBar::movableChanged()
{ DEPENDS_ON("isMovable()"); }
void tst_QToolBar::allowedAreasChanged()
{ DEPENDS_ON("allowedAreas()"); }
void tst_QToolBar::orientationChanged()
{ DEPENDS_ON("orientation()"); }
void tst_QToolBar::iconSizeChanged()
{ DEPENDS_ON("iconSize()"); }
void tst_QToolBar::toolButtonStyleChanged()
{ DEPENDS_ON("toolButtonStyle()"); }
void tst_QToolBar::visibilityChanged()
{
QMainWindow mw;

View File

@ -64,7 +64,6 @@ public slots:
void cleanup();
private slots:
void getSetCheck();
void value();
void type();
void setValue_data();
void setValue();
@ -351,10 +350,5 @@ void tst_QSqlField::type()
QVERIFY( field3.type() == QVariant::Double );
}
void tst_QSqlField::value()
{
DEPENDS_ON( "setValue" );
}
QTEST_MAIN(tst_QSqlField)
#include "tst_qsqlfield.moc"