blob: 98da0e90a25e974bcba90a05235029dfed71df31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "macrowindow.h"
#include <QDomElement>
MacroWindow *createMacroWindow();
QDomElement getWidgetElement(QString type = "",
QString name = "",
QString value = "");
//
// Predefined tests
//
#define TEST_CREATION(W) \
QDomElement n = getWidgetElement(#W, "mywidget"); \
MacroWindow *wnd = createMacroWindow(); \
W wgd(n, wnd); \
#define TEST_DISABLE(W) \
QDomElement n = getWidgetElement(#W, "mywidget"); \
MacroWindow *wnd = createMacroWindow(); \
W wdg(n, wnd); \
wdg.disable(); \
QCOMPARE(wdg.isDisabled(), true); \
wdg.enable(); \
QCOMPARE(wdg.isDisabled(), false);
#define TEST_VALUE(W) \
QDomElement n = getWidgetElement(#W, "mywidget"); \
MacroWindow *wnd = createMacroWindow(); \
W wdg(n, wnd); \
QCOMPARE(wdg.getValue(), QString("")); \
wdg.setValue("hello", "source"); \
QCOMPARE(wdg.getValue(), QString("hello"));
|