>># 
>># 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: stmdfrmppn.m,v 1.12 92/06/11 17:16:38 rws Exp $
>># 
>>#      SCCS:  @(#)  EAll.mc Rel 1.5	    (3/12/92)
>>#
>>TITLE XSetModifierMapping CH07
>>ASSERTION A XSetModifierMapping-1
A succesful call to XSetModifierMapping specifies the
KeyCodes of the keys that are to be used as modifiers and
returns MappingSuccess.
>>STRATEGY
Set up a modifier map.
Call XSetModifierMapping to set servers map.
Verify that MappingSuccess is returned.
Get current map with XGetModifierMapping.
Verify that the mapping has been set correctly.
>>ASSERTION A XSetModifierMapping-2
When a call to XSetModifierMapping succeeds, then a
MappingNotify event is generated.
>>STRATEGY
Call XSetModifierMapping to set mapping.
Verify that a MappingNotify event is generated.
>>ASSERTION - XSetModifierMapping-3
The modifiermap member of the XModifierKeymap structure
contains eight sets of max_keypermod KeyCodes, one for each
modifier in the order Shift, Lock, Control, Mod1, Mod2,
Mod3, Mod4, and Mod5.
>>ASSERTION A XSetModifierMapping-4
When a zero KeyCode occurs in a set, then it is ignored.
>>STRATEGY
Set up a mapping with all keycodes zero.
Set mapping with XSetModifierMapping.
Verify no BadValue error.
>>ASSERTION C XSetModifierMapping-5
When an implementation restriction on which keys can be
used as modifiers is violated, then a call to
XSetModifierMapping returns MappingFailed and none of the
modifiers are changed.
>>STRATEGY
Try in turn all possible keycodes.
If all return MappingSuccess:
  Report unsupported.
else
  Verify that MappingFailed is returned.
  Verify that modifier has not been set to this keycode.
>>ASSERTION B XSetModifierMapping-6
When the new KeyCodes specified for a modifier differ from
those currently defined and any of the current or new keys
for that modifier are in the logically down state, then a
call to XSetModifierMapping returns MappingBusy and none of
the modifiers are changed.
>>STRATEGY
If extension available:
  Get current modifier mapping (other tests may have changed it from origmap).
  Make a new modifier map by permuting the old.
  Check there is at least one non-zero keycode in it.
  Simulate pressing this key using extension.
  Call XSetModifierMapping to set the new mod. map.
  Expect MappingBusy
  Release all keys.
  Get current mapping with XGetModifierMapping.
  Compare with that got at first.
  Remove key from map.
  Simulate pressing key not in the map.
  Call XSetModifierMapping.
  Expect MappingBusy as one of current (at time of XSetModifierMapping call) mod keys pressed.
  Release all keys.
  Call XSetModifierMapping to set up map to not include this key.
  Expect MappingSuccess.
  Simulate pressing key not in the map.
  Call XSetModifierMapping.
  Expect !MappingBusy as key not in current or new maps (at time of XSetModifierMapping call).
  Release all keys.
else
  Report untested.
>>ASSERTION B XSetModifierMapping-7
When the server fails to allocate a required resource, then
a BadAlloc error occurs.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XSetModifierMapping-8
When a KeyCode is not in the range returned by
XDisplayKeycodes, then a BadValue error occurs.
>>STRATEGY
Call XDisplayKeycodes to get range of valid keycodes.
Set up map with keycode less than the minimum value.
Call XSetModifierMapping.
Verify that a BadValue error occurs.

Set up map with keycode greater than the maximum value (if possible).
Call XSetModifierMapping.
Verify that a BadValue error occurs.
