summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-19 17:26:50 -0700
committerKeith Packard <keithp@keithp.com>2011-10-19 17:26:50 -0700
commit15bbdc103b34b6b374815698946e6c409421a644 (patch)
tree76e34f32fe6d564de978f6c184f35b42dc5cd434 /test
parenta5266dcb3a60587e1877f90c18552baf60b597a0 (diff)
parent323869f3298cbbfe864af9404a8aed1bf7995d79 (diff)
Merge remote-tracking branch 'whot/for-keith'
Diffstat (limited to 'test')
-rw-r--r--test/input.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/input.c b/test/input.c
index bc41c226d..347519716 100644
--- a/test/input.c
+++ b/test/input.c
@@ -1199,14 +1199,19 @@ static void dix_input_valuator_masks(void)
assert(valuator_mask_num_valuators(mask) == num_vals);
for (i = 0; i < nvaluators; i++)
{
+ double val;
if (i < first_val || i >= first_val + num_vals)
+ {
assert(!valuator_mask_isset(mask, i));
- else
+ assert(!valuator_mask_fetch_double(mask, i, &val));
+ } else
{
assert(valuator_mask_isset(mask, i));
assert(valuator_mask_get(mask, i) == val_ranged[i - first_val]);
assert(valuator_mask_get_double(mask, i) ==
val_ranged[i - first_val]);
+ assert(valuator_mask_fetch_double(mask, i, &val));
+ assert(val_ranged[i - first_val] == val);
}
}
@@ -1218,10 +1223,18 @@ static void dix_input_valuator_masks(void)
for (i = 0; i < nvaluators; i++)
{
+ double a, b;
assert(valuator_mask_isset(mask, i) == valuator_mask_isset(copy, i));
+
+ if (!valuator_mask_isset(mask, i))
+ continue;
+
assert(valuator_mask_get(mask, i) == valuator_mask_get(copy, i));
assert(valuator_mask_get_double(mask, i) ==
valuator_mask_get_double(copy, i));
+ assert(valuator_mask_fetch_double(mask, i, &a));
+ assert(valuator_mask_fetch_double(copy, i, &b));
+ assert(a == b);
}
valuator_mask_free(&mask);