summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-20 16:49:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-10-25 14:06:41 +1000
commit7500d841f4c709ae0edc6420332096d3b9ef9fcc (patch)
tree01e070e4b8fbb9112f25acca0a74cb781dff39f2
parent4bb5d8fae4f9a70f12591315f0b267a2ea826a0c (diff)
test: fix test with new double -> fp3232 conversion functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--test/xi2/protocol-eventconvert.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index 41a3001ad..ba2d96ad1 100644
--- a/test/xi2/protocol-eventconvert.c
+++ b/test/xi2/protocol-eventconvert.c
@@ -30,6 +30,7 @@
#include "eventstr.h"
#include "eventconvert.h"
#include "exevents.h"
+#include "inpututils.h"
#include <X11/extensions/XI2proto.h>
static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
@@ -104,8 +105,7 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
value = (FP3232*)(((unsigned char*)&out[1]) + out->valuators_len * 4);
value += nvals;
- vi.integral = trunc(in->valuators.data[i]);
- vi.frac = in->valuators.data[i] - vi.integral;
+ vi = double_to_fp3232(in->valuators.data[i]);
vo.integral = value->integral;
vo.frac = value->frac;
@@ -120,8 +120,7 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
raw_value = value + bits_set;
- vi.integral = trunc(in->valuators.data_raw[i]);
- vi.frac = in->valuators.data_raw[i] - vi.integral;
+ vi = double_to_fp3232(in->valuators.data_raw[i]);
vo.integral = raw_value->integral;
vo.frac = raw_value->frac;