/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include "macrowindow.h" #include 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.setEnabled(false); \ QCOMPARE(wdg.enabled(), false); \ wdg.setEnabled(true); \ QCOMPARE(wdg.enabled(), true); #define TEST_VALUE(W) \ QDomElement n = getWidgetElement(#W, "mywidget"); \ MacroWindow *wnd = createMacroWindow(); \ W wdg(n, wnd); \ QCOMPARE(wdg.value(), QString("")); \ wdg.setValue("hello", "source"); \ QCOMPARE(wdg.value(), QString("hello"));