>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: stpntrmppn.m,v 1.9 92/06/11 17:16:46 rws Exp $
>># 
>>#
>>TITLE XSetPointerMapping CH07
>>ASSERTION A XSetPointerMapping-1
A successful call to XSetPointerMapping sets the pointer
mapping for the physical buttons to the nmap logical button
numbers specified in the array map and returns
MappingSuccess.
>>STRATEGY
Get number of buttons.
Set up a pointer mapping.
Set pointer mapping with XSetPointerMapping.
Verify return value.
Get pointer mapping with XGetPointerMapping.
Verify that pointer mapping is as set.
>>ASSERTION A XSetPointerMapping-2
When a call to XSetPointerMapping is successful, then a
MappingNotify event is generated.
>>STRATEGY
Call XSetPointerMapping.
Verify that a MappingNotify event is generated.
>>ASSERTION B XSetPointerMapping-3
When an element of map is zero, then the corresponding
physical button is disabled.
>>STRATEGY
If extension available:
  Create and map a window.
  Select ButtonPress on it.
  For i in 1..numbuttons
    Set map[i-1] to 0.
    Call XSetPointerMapping.
    Discard event queue.
    Simulate button i press with extension.
    Release all buttons etc.
    Check no button press event received.
    Restore map[i-1].
else
  Report untested.
>>ASSERTION A XSetPointerMapping-4
Elements of the map array are not restricted in value by
the number of physical buttons.
>>STRATEGY
Set up map array with button number higher than number of physical buttons.
Call XSetPointerMapping.
Verify no error.
>>ASSERTION B XSetPointerMapping-5
When any of the buttons to be altered are logically in the
down state, then a call to XSetPointerMapping returns
MappingBusy, and the mapping is not changed.
>>STRATEGY
If extension available:
  Set mapping to be each button to itself and save this map.
  For i in 1..numbuttons
    Cycle map so that button i is not itself.
    Simulate button i press
    Call XSetPointerMapping with cycled map so that button i is being altered.
    Release buttons etc.
    Check for MappingBusy.
    Call XGetPointerMapping to get current mapping and current numbuttons.
    Check same as original, saved, values.
else
  Report untested.
>>ASSERTION A XSetPointerMapping-6
When nmap is not the same as the length that
XGetPointerMapping would return, then a BadValue error
occurs.
>>STRATEGY
Set nmap to incorrect value.
Call XSetPointerMapping.
Verify that a BadValue error occurs.
>>ASSERTION C XSetPointerMapping-7
If there is more than one button: When two elements of map
have the same non-zero value, then a BadValue error occurs.
>>STRATEGY
If less than two buttons
  Report unsupported.
Set up a map with two elements the same.
Call XSetPointerMapping.
Verify that a BadValue error occurs.
