summaryrefslogtreecommitdiff
path: root/xts5/tset/Xt9/XtRemoveEventHandler/XtRemoveEventHandler.m
blob: 5da7a461946bb717feff2d29822c1f5f09cfc99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
Copyright (c) 2005 X.Org Foundation LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
$Header: /cvs/xtest/xtest/xts5/tset/Xt9/XtRemoveEventHandler/XtRemoveEventHandler.m,v 1.1 2005-02-12 14:38:24 anderson Exp $

Copyright (c) Applied Testing and Technology, Inc. 1993, 1994, 1995
Copyright (c) 88open Consortium, Ltd. 1990, 1991, 1992, 1993
All Rights Reserved.

>># 
>># Project: VSW5
>># 
>># File: tset/Xt9/XtRemoveEventHandler/XtRemoveEventHandler.m
>># 
>># Description:
>>#	Tests for XtRemoveEventHandler()
>># 
>># Modifications:
>># $Log: trmevthdr.m,v $
>># Revision 1.1  2005-02-12 14:38:24  anderson
>># Initial revision
>>#
>># Revision 8.0  1998/12/23 23:37:12  mar
>># Branch point for Release 5.0.2
>>#
>># Revision 7.0  1998/10/30 23:00:06  mar
>># Branch point for Release 5.0.2b1
>>#
>># Revision 6.0  1998/03/02 05:28:18  tbr
>># Branch point for Release 5.0.1
>>#
>># Revision 5.0  1998/01/26 03:24:52  tbr
>># Branch point for Release 5.0.1b1
>>#
>># Revision 4.0  1995/12/15 09:18:46  tbr
>># Branch point for Release 5.0.0
>>#
>># Revision 3.1  1995/12/15  02:12:09  andy
>># Prepare for GA Release
>>#
>>EXTERN
#include <X11/IntrinsicP.h>
#include <X11/ConstrainP.h>
#include <X11/CoreP.h>

XtAppContext app_ctext;
Widget topLevel, panedw, boxw1, boxw2;
Widget labelw, rowcolw, click_quit;

extern char *event_names[];

/*
** Procedure XtEVT1_Proc
*/
void XtEVT1_Proc(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	if (event->type == ButtonPress) {
		avs_set_event(1,1);
		return;
	}
	if (event->type == KeyPress) {
		avs_set_event(2,1);
		return;
	}
	if (event->type == ButtonRelease) {
		avs_set_event(3,1);
		return;
	}
	if (event->type == KeyRelease) {
		avs_set_event(4,1);
		return;
	}

	sprintf(ebuf, "ERROR: Expected Button or Key event, Received %s", event_names[event->type]);
	tet_infoline(ebuf);
	tet_result(TET_FAIL);
	exit(0);
}
/* procedure XtTMO1_Proc to be invoked */
void XtTMO1_Proc(client_data, id)
XtPointer client_data;
XtIntervalId *id;
{
	exit(0);
}

void XtEVT3_Test(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	sprintf(ebuf, "ERROR: Event %s invoked XtEVT3_Test", event_names[event->type]);
	tet_infoline(ebuf);
	tet_result(TET_FAIL);
}
/*
** Procedure XtEVT3_Proc
*/
void XtEVT3_Proc(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	if ( event->type == ButtonPress )
	avs_set_event(1,1);
	else {
		sprintf(ebuf, "ERROR: Expected ButtonPress event Received %s", event_names[event->type]);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	exit(0);
}

/*
** Procedure XtEVT2_Proc
*/
void XtEVT2_Proc(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	if ( event->type == ButtonPress )
	avs_set_event(1,1);
	else {
		sprintf(ebuf, "ERROR: Expected ButtonPress event Received %s", event_names[event->type]);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	exit(0);
}
/*
** Procedure XtEVT4_Proc
*/
void XtEVT4_Proc(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	if ((event->type == ButtonPress) || (event->type == KeyPress))
		avs_set_event(1, avs_get_event(1)+1);
	else {
		sprintf(ebuf, "ERROR: Expected ButtonPress and KeyPress events, Received %s", event_names[event->type]);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
}
/*
** Procedure XtEVT4a_Proc
*/
void XtEVT4a_Proc(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	if ((event->type == ButtonRelease) || (event->type == KeyRelease))
		avs_set_event(2, avs_get_event(2)+1);
	else {
		sprintf(ebuf, "ERROR: Expected ButtonPress and KeyPress events, Received %s", event_names[event->type]);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
}
/* procedure XtTMO4_Proc to be invoked */
void XtTMO4_Proc(client_data, id)
XtPointer client_data;
XtIntervalId *id;
{
	exit(0);
}
/*
** Warning handler
*/
void XtWMH_Proc(str1, str2, str3, str4, str5, car)
String str1, str2, str3, str4, *str5;
Cardinal *car;
{
	avs_set_event(2,1);
}
/*
** Error handler
*/
void XtEMH_Proc(str1, str2, str3, str4, str5, car)
String str1, str2, str3, str4, *str5;
Cardinal *car;
{
	avs_set_event(3,1);
}
void XtEVT_ProcA(w, client_data, event, continue_to_dispatch)
Widget w;
XtPointer client_data;
XEvent *event;
Boolean *continue_to_dispatch;
{
	if (event->type == GraphicsExpose )
	avs_set_event(1,1);
	else {
		sprintf(ebuf, "ERROR: Expected GraphicsExpose event Received %s", event_names[event->type]);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	exit(0);
}
>>SET tpstartup avs_alloc_sem
>>SET tpcleanup avs_free_sem
>>TITLE XtRemoveEventHandler Xt9
void
XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data)
>>ASSERTION Good A
When 
.A proc 
and 
.A client_data 
match a handler/data pair previously registered for the widget
.A w
by a call to
XtAddEventHandler or XtInsertEventHandler a successful call to 
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data) 
shall unregister the procedure for the events specified by 
.A event_mask.
>>CODE
Widget labelw_msg;
char *msg = "Event widget";
pid_t pid2;
int invoked = 0;

	FORK(pid2);
	avs_xt_hier("Trmevthdr1", "XtRemoveEventHandler");
	tet_infoline("PREP: Create a test labelw_msg widget");
	labelw_msg = (Widget) CreateLabelWidget(msg, boxw1);
	tet_infoline("PREP: Create windows for widgets and map them");
	XtRealizeWidget(topLevel);
	tet_infoline("PREP: Register XtEVT1_Proc to handle ButtonPress events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Register XtEVT1_Proc to handle KeyPress events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 KeyPressMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Insert XtEVT1_Proc to handle ButtonRelease events to labelw_msg");
	XtInsertEventHandler(labelw_msg,
		 ButtonReleaseMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL,
		 XtListHead
		 );
	tet_infoline("PREP: Insert XtEVT1_Proc to handle KeyRelease events to labelw_msg");
	XtInsertEventHandler(labelw_msg,
		 KeyReleaseMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL,
		 XtListTail
		 );
	tet_infoline("PREP: Remove XtEVT1_Proc for ButtonPress events");
	XtRemoveEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Remove XtEVT1_Proc for KeyRelease events");
	XtRemoveEventHandler(labelw_msg,
		 KeyReleaseMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Send ButtonPress event");
	send_event(labelw_msg, ButtonPress, ButtonPressMask, FALSE);
	tet_infoline("PREP: Send KeyPress event");
	send_event(labelw_msg, KeyPress, KeyPressMask, FALSE);
	tet_infoline("PREP: Send ButtonRelease event");
	send_event(labelw_msg, ButtonRelease, ButtonReleaseMask, FALSE);
	tet_infoline("PREP: Send KeyRelease event");
	send_event(labelw_msg, KeyRelease, KeyReleaseMask, FALSE);
	tet_infoline("PREP: Register timeout procedure");
	XtAppAddTimeOut(app_ctext, AVSXTLOOPTIMEOUT, XtTMO1_Proc, topLevel);
	XtAppMainLoop(app_ctext);
	LKROF(pid2, AVSXTTIMEOUT-2);
	tet_infoline("TEST: Procedure XtEVT1_Proc was invoked only for KeyPress and ButtonRelease");
	if (avs_get_event(1) != 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was invoked for ButtonPress");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(2) == 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was not invoked for KeyPress");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(4) != 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was invoked for KeyRelease");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(3) == 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was not invoked for ButtonRelease");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_result(TET_PASS);
>>ASSERTION Good A
When 
.A proc 
and 
.A client_data 
match a handler/data pair previously registered for non-maskable
events and 
.A nonmaskable
is
.S True
a successful call to 
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data) 
shall unregister the procedure for all non-maskable events.
>>CODE
Widget labelw_msg;
char *msg = "Event widget";
pid_t pid2;
int invoked = 0;

	FORK(pid2);
	avs_xt_hier("Trmevthdr1", "XtRemoveEventHandler");
	tet_infoline("PREP: Create a test labelw_msg widget");
	labelw_msg = (Widget) CreateLabelWidget(msg, boxw1);
	tet_infoline("PREP: Create windows for widgets and map them");
	XtRealizeWidget(topLevel);
	tet_infoline("PREP: Register procedure to handle non-maskable events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 0,
		 True,
		 XtEVT_ProcA,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Remove procedure for nonmaskable events");
	XtRemoveEventHandler(labelw_msg,
		 0,
		 True,
		 XtEVT_ProcA,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Send GraphicsExpose event");
	send_event(labelw_msg, GraphicsExpose, 0, FALSE);
	XtAppAddTimeOut(app_ctext, AVSXTLOOPTIMEOUT, XtTMO1_Proc, topLevel);
	XtAppMainLoop(app_ctext);
	LKROF(pid2, AVSXTTIMEOUT-2);
	tet_infoline("TEST: Procedure was not invoked");
	if (avs_get_event(1) != 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was invoked for GraphicsExpose");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_result(TET_PASS);
>>ASSERTION Good A
When 
.A client_data 
does not match the value used when the procedure
.A proc
was registered a call to
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data)
shall return without performing any action.
>>CODE
Widget labelw_msg;
char *msg = "Event widget";
pid_t pid2;
int invoked = 0;

	FORK(pid2);
	avs_xt_hier("Trmevthdr2", "XtRemoveEventHandler");
	tet_infoline("PREP: Create a test labelw_msg widget");
	labelw_msg = (Widget) CreateLabelWidget(msg, boxw1);
	tet_infoline("PREP: Create windows for widgets and map them");
	XtRealizeWidget(topLevel);
	tet_infoline("PREP: Register XtEVT2_Proc to handle events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT2_Proc,
		 (Widget)topLevel
		 );
	tet_infoline("PREP: Set up test XtToolkitError handler");
	XtAppSetErrorMsgHandler(app_ctext, XtEMH_Proc);
	tet_infoline("PREP: Set Warning Message Handler");
	XtAppSetWarningMsgHandler(app_ctext, XtWMH_Proc);
	tet_infoline("PREP: Remove the event handler with different client_data");
	XtRemoveEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT2_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Send event for which handler was registered");
	send_event(labelw_msg, ButtonPress, ButtonPressMask, FALSE);
	XtAppMainLoop(app_ctext);
	LKROF(pid2, AVSXTTIMEOUT-2);
	tet_infoline("TEST: Error message was not emitted");
	if (avs_get_event(3) != 0) {
		sprintf(ebuf, "ERROR: Error message handler was invoked %d times");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(2) != 0) {
		sprintf(ebuf, "ERROR: Warning message handler was invoked %d times");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_infoline("TEST: Handler was invoked");
	invoked = avs_get_event(1);
	if (!invoked) {
		sprintf(ebuf, "ERROR: Handler was not invoked");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_result(TET_PASS);
>>ASSERTION Good A
When the procedure
.A proc 
has not been registered previously for the specified widget a call to
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data)
shall return without performing any action.
>>CODE
Widget labelw_msg;
char *msg = "Event widget";
pid_t pid2;
int invoked = 0;

	FORK(pid2);
	avs_xt_hier("Trmevthdr3", "XtRemoveEventHandler");
	tet_infoline("PREP: Create a test labelw_msg widget");
	labelw_msg = (Widget) CreateLabelWidget(msg, boxw1);
	tet_infoline("PREP: Set up test XtToolkitError handler");
	XtRealizeWidget(topLevel);
	tet_infoline("PREP: Register XtEVT3_Proc to handle events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT3_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Set up test XtToolkitError handler");
	XtAppSetErrorMsgHandler(app_ctext, XtEMH_Proc);
	tet_infoline("PREP: Set Warning Message Handler");
	XtAppSetWarningMsgHandler(app_ctext, XtWMH_Proc);
	tet_infoline("PREP: Remove a non-registered event handler");
	XtRemoveEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT3_Test,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Send event for which handler was registered");
	send_event(labelw_msg, ButtonPress, ButtonPressMask, FALSE);
	XtAppMainLoop(app_ctext);
	LKROF(pid2, AVSXTTIMEOUT-2);
	tet_infoline("TEST: Handler was invoked");
	invoked = avs_get_event(1);
	if (!invoked) {
		sprintf(ebuf, "ERROR: Handler was not invoked");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_infoline("TEST: Error message was not emitted");
	if (avs_get_event(3) != 0) {
		sprintf(ebuf, "ERROR: Error message handler was invoked %d times");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(2) != 0) {
		sprintf(ebuf, "ERROR: Warning message handler was invoked %d times");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_result(TET_PASS);
>>ASSERTION Good A
When 
.A event_mask 
is XtAllEvents and 
.A nonmaskable 
is True a successful call to
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data)
shall cause the procedure
.A proc
to be not called on any event for which it was previously registered by
calls to XtAddEventHandler or XtInsertEventHandler.
>>CODE
Widget labelw_msg;
char *msg = "Event widget";
pid_t pid2;
int invoked = 0;

	FORK(pid2);
	avs_xt_hier("Trmevthdr4", "XtRemoveEventHandler");
	tet_infoline("PREP: Create a test labelw_msg widget");
	labelw_msg = (Widget) CreateLabelWidget(msg, boxw1);
	tet_infoline("PREP: Create windows for widgets and map them");
	XtRealizeWidget(topLevel);
	tet_infoline("PREP: Register XtEVT4_Proc to handle events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 ButtonPressMask|KeyPressMask,
		 False,
		 XtEVT4_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Insert XtEVT4a_Proc to handle events to labelw_msg");
	XtInsertEventHandler(labelw_msg,
		 ButtonReleaseMask|KeyReleaseMask,
		 False,
		 XtEVT4_Proc,
		 (XtPointer)NULL,
		 XtListHead
		 );
	tet_infoline("PREP: Remove previously registered event handlers");
	XtRemoveEventHandler(labelw_msg,
		 XtAllEvents,
		 True,
		 XtEVT4a_Proc,
		 (XtPointer)NULL
		 );
	XtRemoveEventHandler(labelw_msg,
		 XtAllEvents,
		 True,
		 XtEVT4_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Register timeout procedure");
	XtAppAddTimeOut(app_ctext, AVSXTLOOPTIMEOUT, XtTMO4_Proc, topLevel);
	tet_infoline("TEST: Send all registered events for the two handlers");
	send_event(labelw_msg, ButtonPress, ButtonPressMask, FALSE);
	send_event(labelw_msg, KeyPress, KeyPressMask, FALSE);
	send_event(labelw_msg, ButtonRelease, ButtonReleaseMask, FALSE);
	send_event(labelw_msg, KeyRelease, KeyReleaseMask, FALSE);
	XtAppMainLoop(app_ctext);
	LKROF(pid2, AVSXTTIMEOUT-2);
	tet_infoline("TEST: Handlers were not invoked");
	invoked = avs_get_event(1);
	if (invoked != 0) {
		sprintf(ebuf, "ERROR: XtEVT4_Proc was invoked %d times", invoked);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	invoked = avs_get_event(2);
	if (invoked != 0) {
		sprintf(ebuf, "ERROR:  XtEVT4a_Proc was invoked %d times", invoked);
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_result(TET_PASS);
>>ASSERTION Good A
After a successful call to
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data)
when 
.A event_mask 
is XtAllEvents and 
.A nonmaskable 
is True the procedure 
.A proc 
shall continue to be called for those events for which it was previously 
registered by calls to XtAddRawEventHandler and XtInsertRawEventHandler.
>>CODE
Widget labelw_msg;
char *msg = "Event widget";
pid_t pid2;
int invoked = 0;

	FORK(pid2);
	avs_xt_hier("Trmevthdr5", "XtRemoveEventHandler");
	tet_infoline("PREP: Create a test labelw_msg widget");
	labelw_msg = (Widget) CreateLabelWidget(msg, boxw1);
	tet_infoline("PREP: Create windows for widgets and map them");
	XtRealizeWidget(topLevel);
	tet_infoline("PREP: Add XtEVT1_Proc to handle events to labelw_msg");
	XtAddEventHandler(labelw_msg,
		 ButtonPressMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Raw Add XtEVT1_Proc to handle events to labelw_msg");
	XtAddRawEventHandler(labelw_msg,
		 KeyReleaseMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Raw Insert XtEVT1_Proc to handle events to labelw_msg");
	XtInsertRawEventHandler(labelw_msg,
		 KeyPressMask,
		 False,
		 XtEVT1_Proc,
		 (XtPointer)NULL,
		 XtListHead
		 );
	tet_infoline("PREP: Unregister event handler for all events");
	XtRemoveEventHandler(labelw_msg,
		 XtAllEvents,
		 True,
		 XtEVT1_Proc,
		 (XtPointer)NULL
		 );
	tet_infoline("PREP: Register timeout procedure");
	XtAppAddTimeOut(app_ctext, AVSXTLOOPTIMEOUT, XtTMO4_Proc, topLevel);
	tet_infoline("TEST: Send all registered events to the widget");
	send_event(labelw_msg, ButtonPress, ButtonPressMask, FALSE);
	send_event(labelw_msg, KeyRelease, KeyReleaseMask, TRUE);
	send_event(labelw_msg, KeyPress, KeyPressMask, TRUE);
	XtAppMainLoop(app_ctext);
	LKROF(pid2, AVSXTTIMEOUT-2);
	tet_infoline("TEST: Handler was invoked but only for raw events");
	if (avs_get_event(1) != 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was invoked for ButtonPress");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(2) == 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was not invoked for KeyPress");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	if (avs_get_event(4) == 0) {
		sprintf(ebuf, "ERROR: XtEVT1_Proc was not invoked for KeyRelease");
		tet_infoline(ebuf);
		tet_result(TET_FAIL);
	}
	tet_result(TET_PASS);
>>ASSERTION Good B 1
When the widget
.A w 
is realized a successful call to 
void XtRemoveEventHandler(w, event_mask, nonmaskable, proc, client_data)
shall modify the event_mask attribute of the widget window.