summaryrefslogtreecommitdiff
path: root/client/test/testlineedit.cc
diff options
context:
space:
mode:
authordeva <deva>2009-08-31 11:33:57 +0000
committerdeva <deva>2009-08-31 11:33:57 +0000
commit86bd08d47842e5681835412ac6c08d7135a6adc5 (patch)
tree767a04c8e126d152bab922629a65a4f3e02d0953 /client/test/testlineedit.cc
parent6cbc11417ee97c50fadedc1cb976f15a0c69fecc (diff)
Initial attempt on a unit test system.
Diffstat (limited to 'client/test/testlineedit.cc')
-rw-r--r--client/test/testlineedit.cc55
1 files changed, 55 insertions, 0 deletions
diff --git a/client/test/testlineedit.cc b/client/test/testlineedit.cc
new file mode 100644
index 0000000..4eb886b
--- /dev/null
+++ b/client/test/testlineedit.cc
@@ -0,0 +1,55 @@
+#include <QtTest/QtTest>
+#include "util.h"
+#include "lineedit.h"
+
+class TestLineEdit: public QObject
+{
+Q_OBJECT
+private slots:
+ void creation() { TEST_CREATION(LineEdit); }
+ void disable() { TEST_DISABLE(LineEdit); }
+ void value() { TEST_VALUE(LineEdit); }
+ void edit()
+ {
+ QDomElement e = getWidgetElement("LineEdit", "mywidget");
+ MacroWindow *wnd = createMacroWindow();
+ LineEdit le(e, wnd);
+ QTest::keyClicks(&le, "hello");
+ QCOMPARE(le.getValue(), QString("hello"));
+ }
+};
+
+QTEST_MAIN(TestLineEdit)
+#include "testlineedit.moc"
+
+/**
+class LineEdit : public QLineEdit, public Widget
+{
+Q_OBJECT
+public:
+ LineEdit(QDomNode &node, MacroWindow *macrowindow);
+
+ QString getValue();
+ void setValue(QString value, QString source = "");
+
+ void enable();
+ void disable();
+ bool isDisabled();
+
+ void connectFrom(const char *signal,
+ const QObject *receiver, const char *method);
+
+ void connectTo(const QObject *sender, const char *signal,
+ const char *method);
+
+ bool setKeyboardFocus();
+ void setVisibility(bool visible);
+
+public slots:
+ void changed();
+ void user_changed();
+
+signals:
+ void wasChanged();
+};
+ **/