diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2022-02-05 18:53:38 +0200 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2022-02-05 19:08:22 +0200 |
commit | 4c2d751df9db11e8ea14dc60bf936a8aa56227f7 (patch) | |
tree | 3619225e8de623aa2f4f733f414cbf4ea0ec2740 | |
parent | 0706c69c071475aa63e091296f5056ae4874f71b (diff) |
common: Detect invalid usage of XITProperty
-rw-r--r-- | tests/common/xit-property.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/common/xit-property.h b/tests/common/xit-property.h index b0d2818..f0d8856 100644 --- a/tests/common/xit-property.h +++ b/tests/common/xit-property.h @@ -101,6 +101,12 @@ XITProperty<DataType>::XITProperty(::Display *dpy, int deviceid, const std::stri XIGetProperty(dpy, deviceid, prop, 0, 1000, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &d); + if (format != sizeof(DataType) * 8) { + ADD_FAILURE() << "Property " << propname << " has different number of bits on server: " + << format << " expected: " << sizeof(DataType) * 8; + return; + } + if (!d) return; |