mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-12 08:02:00 +02:00
correct way to deal with object clipboard in unit tests; another patch from persgray@gmail.com
This commit is contained in:
@@ -182,10 +182,10 @@ void CustomServiceDialogTest::testDialog()
|
|||||||
selectComboItem(platform, "iptables");
|
selectComboItem(platform, "iptables");
|
||||||
dialog->platformChanged();
|
dialog->platformChanged();
|
||||||
QTest::mouseClick(ipv6, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
QTest::mouseClick(ipv6, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
||||||
QVERIFY(service->getAddressFamily() == 10);
|
QVERIFY(service->getAddressFamily() == AF_INET6);
|
||||||
selectComboItem(platform, "PF");
|
selectComboItem(platform, "PF");
|
||||||
dialog->platformChanged();
|
dialog->platformChanged();
|
||||||
QVERIFY(service->getAddressFamily() == 10);
|
QVERIFY(service->getAddressFamily() == AF_INET6);
|
||||||
|
|
||||||
// testing that changing address family does not change platform code
|
// testing that changing address family does not change platform code
|
||||||
foreach (QString key, platforms.keys())
|
foreach (QString key, platforms.keys())
|
||||||
@@ -193,11 +193,11 @@ void CustomServiceDialogTest::testDialog()
|
|||||||
string oldcode = service->getCodeForPlatform(key.toStdString().c_str());
|
string oldcode = service->getCodeForPlatform(key.toStdString().c_str());
|
||||||
string oldprotocol = service->getProtocol();
|
string oldprotocol = service->getProtocol();
|
||||||
QTest::mouseClick(ipv4, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
QTest::mouseClick(ipv4, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
||||||
QVERIFY(service->getAddressFamily() == 2);
|
QVERIFY(service->getAddressFamily() == AF_INET);
|
||||||
QVERIFY(oldcode == service->getCodeForPlatform(key.toStdString().c_str()));
|
QVERIFY(oldcode == service->getCodeForPlatform(key.toStdString().c_str()));
|
||||||
QVERIFY(oldprotocol == service->getProtocol());
|
QVERIFY(oldprotocol == service->getProtocol());
|
||||||
QTest::mouseClick(ipv6, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
QTest::mouseClick(ipv6, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
||||||
QVERIFY(service->getAddressFamily() == 10);
|
QVERIFY(service->getAddressFamily() == AF_INET6);
|
||||||
QVERIFY(oldcode == service->getCodeForPlatform(key.toStdString().c_str()));
|
QVERIFY(oldcode == service->getCodeForPlatform(key.toStdString().c_str()));
|
||||||
QVERIFY(oldprotocol == service->getProtocol());
|
QVERIFY(oldprotocol == service->getProtocol());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ using namespace libfwbuilder;
|
|||||||
|
|
||||||
void RuleSetViewContextMenuTest::initTestCase()
|
void RuleSetViewContextMenuTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->move(0,0);
|
mw->move(0,0);
|
||||||
@@ -60,7 +61,6 @@ void RuleSetViewContextMenuTest::initTestCase()
|
|||||||
else
|
else
|
||||||
mw->resize(1024, 768);
|
mw->resize(1024, 768);
|
||||||
mw->startupLoad();
|
mw->startupLoad();
|
||||||
new FWObjectClipboard();
|
|
||||||
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
||||||
if (d!=NULL) d->close();
|
if (d!=NULL) d->close();
|
||||||
om = dynamic_cast<ObjectManipulator*>(mw->getCurrentObjectTree()->parent()->parent());
|
om = dynamic_cast<ObjectManipulator*>(mw->getCurrentObjectTree()->parent()->parent());
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ using namespace libfwbuilder;
|
|||||||
|
|
||||||
void RuleSetViewTest::initTestCase()
|
void RuleSetViewTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->resize(QSize(800,600));
|
mw->resize(QSize(800,600));
|
||||||
mw->startupLoad();
|
mw->startupLoad();
|
||||||
new FWObjectClipboard();
|
|
||||||
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
||||||
if (d) if (d!=NULL) d->close();
|
if (d) if (d!=NULL) d->close();
|
||||||
om = dynamic_cast<ObjectManipulator*>(mw->getCurrentObjectTree()->parent()->parent());
|
om = dynamic_cast<ObjectManipulator*>(mw->getCurrentObjectTree()->parent()->parent());
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ using namespace libfwbuilder;
|
|||||||
|
|
||||||
void instDialogClusterTest::initTestCase()
|
void instDialogClusterTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
wfl = new UserWorkflow();
|
wfl = new UserWorkflow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->loadFile("test_work.fwb", false);
|
mw->loadFile("test_work.fwb", false);
|
||||||
new FWObjectClipboard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void instDialogClusterTest::openPolicy(QString fwname)
|
void instDialogClusterTest::openPolicy(QString fwname)
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ using namespace libfwbuilder;
|
|||||||
|
|
||||||
void instDialogCompileTest::initTestCase()
|
void instDialogCompileTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->loadFile("test_work.fwb", false);
|
mw->loadFile("test_work.fwb", false);
|
||||||
new FWObjectClipboard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkProgress(QTreeWidget *list)
|
bool checkProgress(QTreeWidget *list)
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ bool checkProgress(QTreeWidget *list)
|
|||||||
|
|
||||||
void instDialogInspectTest::initTestCase()
|
void instDialogInspectTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->loadFile("test_work.fwb", false);
|
mw->loadFile("test_work.fwb", false);
|
||||||
new FWObjectClipboard();
|
|
||||||
dialogClosed = false;
|
dialogClosed = false;
|
||||||
om = mw->findChild<ObjectManipulator*>("om");
|
om = mw->findChild<ObjectManipulator*>("om");
|
||||||
tree = mw->activeProject()->getCurrentObjectTree();
|
tree = mw->activeProject()->getCurrentObjectTree();
|
||||||
|
|||||||
@@ -128,10 +128,10 @@ bool checkProgress(QTreeWidget *list)
|
|||||||
|
|
||||||
void instDialogInstallTest::initTestCase()
|
void instDialogInstallTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->loadFile("test_work.fwb", false);
|
mw->loadFile("test_work.fwb", false);
|
||||||
new FWObjectClipboard();
|
|
||||||
ssh_auth_sock = getenv("SSH_AUTH_SOCK");
|
ssh_auth_sock = getenv("SSH_AUTH_SOCK");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,10 +105,10 @@ using namespace libfwbuilder;
|
|||||||
|
|
||||||
void instDialogObjectListTest::initTestCase()
|
void instDialogObjectListTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
new FWObjectClipboard();
|
||||||
mw = new FWWindow();
|
mw = new FWWindow();
|
||||||
mw->show();
|
mw->show();
|
||||||
mw->loadFile("test_work.fwb", false);
|
mw->loadFile("test_work.fwb", false);
|
||||||
new FWObjectClipboard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void instDialogObjectListTest::openPolicy(QString fwname)
|
void instDialogObjectListTest::openPolicy(QString fwname)
|
||||||
|
|||||||
@@ -78,6 +78,4 @@ void build_app(int argc, char** argv,
|
|||||||
qt_translator.load(QLatin1String("qt_") + QLocale::system().name(),
|
qt_translator.load(QLatin1String("qt_") + QLocale::system().name(),
|
||||||
qt_resource_dir);
|
qt_resource_dir);
|
||||||
(*app)->installTranslator (&qt_translator);
|
(*app)->installTranslator (&qt_translator);
|
||||||
|
|
||||||
new FWObjectClipboard();
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user