//TESTED_CLASS=
//TESTED_FILES=
-#ifndef QT_NO_PRINTER
-
class tst_QPrinter : public QObject
{
Q_OBJECT
-public:
- tst_QPrinter();
- virtual ~tst_QPrinter();
-
-
+#ifdef QT_NO_PRINTER
public slots:
void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
+#else
private slots:
void getSetCheck();
// Add your testfunctions and testdata create functions here
void taskQTBUG4497_reusePrinterOnDifferentFiles();
void testPdfTitle();
+#endif
};
+#ifdef QT_NO_PRINTER
+void tst_QPrinter::initTestCase()
+{
+ QSKIP("This test requires printing support", SkipAll);
+}
+
+#else
+
// Testing get/set functions
void tst_QPrinter::getSetCheck()
{
QCOMPARE(QPrinter::PrintRange(QPrinter::PageRange), obj1.printRange());
}
-tst_QPrinter::tst_QPrinter()
-{
-}
-
-tst_QPrinter::~tst_QPrinter()
-{
-}
-
-// initTestCase will be executed once before the first testfunction is executed.
-void tst_QPrinter::initTestCase()
-{
-// TODO: Add testcase generic initialization code here.
-// suggestion:
-// testWidget = new QPrinter(0,"testWidget");
-// testWidget->setFixedSize(200, 200);
-// qApp->setMainWidget(testWidget);
-// testWidget->show();
-}
-
-// cleanupTestCase will be executed once after the last testfunction is executed.
-void tst_QPrinter::cleanupTestCase()
-{
-// TODO: Add testcase generic cleanup code here.
-// suggestion:
-// testWidget->hide();
-// qApp->setMainWidget(0);
-// delete testWidget;
-}
-
-// init() will be executed immediately before each testfunction is run.
-void tst_QPrinter::init()
-{
-// TODO: Add testfunction specific initialization code here.
-}
-
-// cleanup() will be executed immediately after each testfunction is run.
-void tst_QPrinter::cleanup()
-{
-// TODO: Add testfunction specific cleanup code here.
-}
-
#define MYCOMPARE(a, b) QCOMPARE(QVariant((int)a), QVariant((int)b))
void tst_QPrinter::testPageSetupDialog()
QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
}
+#endif
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"
-
-#else //QT_NO_PRINTER
-
-QTEST_NOOP_MAIN
-
-#endif //QT_NO_PRINTER
#include <QtGlobal>
#include <QtAlgorithms>
#include <QtNetwork/QHostInfo>
-
-#ifndef QT_NO_PRINTER
#include <qprinterinfo.h>
#ifdef Q_OS_UNIX
{
Q_OBJECT
-public:
- //tst_QPrinterInfo();
- //virtual ~tst_QPrinterInfo();
-
-
+#ifdef QT_NO_PRINTER
public slots:
- //void initTestCase();
- //void cleanupTestCase();
- //void init();
- //void cleanup();
+ void initTestCase();
+#else
private slots:
#if defined(Q_OS_UNIX) || defined(Q_OS_WIN32)
void testForDefaultPrinter();
QStringList getPrintersFromSystem();
QString getOutputFromCommand(const QStringList& command);
+#endif
};
+#ifdef QT_NO_PRINTER
+void tst_QPrinterInfo::initTestCase()
+{
+ QSKIP("This test requires printing support", SkipAll);
+}
+
+#else
+
void tst_QPrinterInfo::macFixNameFormat(QString *printerName)
{
// Modify the format of the printer name to match Qt, lpstat returns
}
}
+#endif
+
QTEST_MAIN(tst_QPrinterInfo)
#include "tst_qprinterinfo.moc"
-#else
-QTEST_NOOP_MAIN
-#endif
//TESTED_CLASS=
//TESTED_FILES=
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
-
class tst_QAbstractPrintDialog : public QObject
{
Q_OBJECT
-public:
- tst_QAbstractPrintDialog();
- virtual ~tst_QAbstractPrintDialog();
-
+#if defined(QT_NO_PRINTER) || defined(QT_NO_PRINTDIALOG)
+public slots:
+ void initTestCase();
+#else
private slots:
void getSetCheck();
void setMinMax();
void setFromTo();
+#endif
};
+#if defined(QT_NO_PRINTER) || defined(QT_NO_PRINTDIALOG)
+void tst_QAbstractPrintDialog::initTestCase()
+{
+ QSKIP("This test requires printing and print dialog support", SkipAll);
+}
+
+#else
+
class MyAbstractPrintDialog : public QAbstractPrintDialog
{
public:
int exec() { return 0; }
};
-tst_QAbstractPrintDialog::tst_QAbstractPrintDialog()
-{
-}
-
-tst_QAbstractPrintDialog::~tst_QAbstractPrintDialog()
-{
-}
-
// Testing get/set functions
void tst_QAbstractPrintDialog::getSetCheck()
{
QCOMPARE(obj1.maxPage(), 50);
}
+#endif
+
QTEST_MAIN(tst_QAbstractPrintDialog)
#include "tst_qabstractprintdialog.moc"
-
-#else
-
-QTEST_NOOP_MAIN
-
-#endif