summaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-13 11:20:15 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-13 15:13:26 +1000
commit7e263757d341f0bfdcfe374b757dbdfd4cc26cc1 (patch)
treed058a0646e46a8422f9cdccf813a3f0aef249a47 /tests/server
parentd768e2db90a06c99b28ef079c3c7f2b78b6c4528 (diff)
server/barriers: slot in another base class for XFixes registration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/barriers-common.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/tests/server/barriers-common.h b/tests/server/barriers-common.h
index 47accb9..5cd2830 100644
--- a/tests/server/barriers-common.h
+++ b/tests/server/barriers-common.h
@@ -10,20 +10,18 @@
#include "xit-server-input-test.h"
#include "device-interface.h"
-class BarrierTest : public XITServerInputTest,
- public DeviceInterface {
+class BarrierBaseTest : public XITServerInputTest {
public:
int xfixes_opcode;
int xfixes_event_base;
int xfixes_error_base;
- /**
- * Initializes a standard mouse device.
- */
- virtual void SetUp() {
- SetDevice("mice/PIXART-USB-OPTICAL-MOUSE-HWHEEL.desc");
+ virtual void SetUp(void) {
XITServerInputTest::SetUp();
+ RequireXFixes(5, 0);
+ }
+ virtual void RequireXFixes(int major_req, int minor_req) {
if (!XQueryExtension (Display(), XFIXES_NAME,
&xfixes_opcode,
&xfixes_event_base,
@@ -33,8 +31,23 @@ public:
int major, minor;
if (!XFixesQueryVersion (Display(), &major, &minor) ||
- major < 5)
- ADD_FAILURE () << "Need XFixes 5 or later\n";
+ major * 100 + minor < major_req * 100 + minor_req)
+ ADD_FAILURE () << "Need XFixes " << major_req << "." << minor_req << ", got " << major << "." << minor;
+
+ }
+
+};
+
+class BarrierTest : public BarrierBaseTest,
+ public DeviceInterface {
+public:
+
+ /**
+ * Initializes a standard mouse device.
+ */
+ virtual void SetUp() {
+ SetDevice("mice/PIXART-USB-OPTICAL-MOUSE-HWHEEL.desc");
+ BarrierBaseTest::SetUp();
}
/**
@@ -56,7 +69,7 @@ public:
}
};
-class BarrierDevices : public XITServerInputTest {
+class BarrierDevices : public BarrierBaseTest {
public:
std::auto_ptr<xorg::testing::evemu::Device> dev1;
std::auto_ptr<xorg::testing::evemu::Device> dev2;
@@ -66,7 +79,8 @@ public:
virtual void SetUp() {
SetUpDevices();
- XITServerInputTest::SetUp();
+ BarrierBaseTest::SetUp();
+
ConfigureDevices();
}