summaryrefslogtreecommitdiff
path: root/xc/unsupported/test/suspex/testcases/lut_hp/lut_errors.c
blob: aa5dd5e4340557a5849d6983a2a7a6133d7c5448 (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
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
/* $XConsortium: lut_errors.c,v 1.0 93/11/22 12:28:41 rws Exp $ */

/******************************************************************************/
/*                                                                            */
/*  (c) Copyright Hewlett-Packard Company, 1993, Fort Collins, Colorado       */
/*                                                                            */
/*                            All Rights Reserved                             */
/*                                                                            */
/*  Permission to use, copy, modify, and distribute this software and its     */
/*  documentation for any purpose and without fee is hereby granted,          */
/*  provided that the above copyright notices appear in all copies and that   */
/*  both the copyright notices and this permission notice appear in           */
/*  supporting documentation, and that the name of Hewlett-Packard not be     */
/*  used in advertising or publicity pertaining to distribution of the        */
/*  software without specific, written prior permission.                      */
/*                                                                            */
/*  HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS         */
/*  SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF        */
/*  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Hewlett-Packard    */
/*  shall not be liable for errors contained herein or direct, indirect,      */
/*  special, incidental or consequential damages in connection with the       */
/*  furnishing, performance or use of this software.                          */
/*                                                                            */
/******************************************************************************/

/*
 * lut_errors
 *
 * This test tests that we get the expected errors for bogus parameters
 *
 * Oct 29, 1992 	Ken Tidwell
 */
 
/*
 * Basic set of include files for tests
 */
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/PEX5/PEXlib.h>
#include "misc.h"
#include "err_handler.h"

Window local_window;

#define NUM_LUTS 12
#define NUM_ENTRIES (NUM_LUTS + 1)

void lut_test(Display *display,
	      Window   window)
{
    char *protocol_mode;
 
    /*************************************************************************
     * Test specific data
     ************************************************************************/
    PEXLookupTable luts[NUM_ENTRIES];     /* 12 lut types, 0'th entry ignored */
    PEXTableInfo lut_info[NUM_ENTRIES];	  /* 12 lut types, 0'th entry ignored */
    PEXPointer entries [NUM_ENTRIES];	  /* 12 lut types, 0'th entry ignored */
    PEXLookupTable color_lut, line_lut;
    PEXStructure str;
    PEXTableInfo table_info;
    PEXPointer predef_entries; 

    int i, j;
    int table_type;
    Status status;
    unsigned long return_count;
    PEXTableIndex *return_indices;

    PEXLineBundleEntry 		LineBundle;
    PEXMarkerBundleEntry 	MarkerBundle;
    PEXTextBundleEntry 		TextBundle;
    PEXInteriorBundleEntry 	InteriorBundle;
    PEXEdgeBundleEntry 		EdgeBundle;
    PEXColorEntry 		Color;
    PEXTextFontEntry 		TextFont;
    PEXLightEntry 		Light;
    PEXDepthCueEntry 		DepthCue;
    PEXColorApproxEntry 	ColorApprox;
    PEXViewEntry 		View;
    PEXPatternEntry             Pattern;

    int				err_mask = ERROR_CODE | REQUEST_CODE;

    /**********************************************************************
     * Test begins here
     *********************************************************************/

    /**********************************************************************
     * Test 1
     *
     * Create Lookup Table
     *********************************************************************/
    {
	PEXLookupTable lut;

	/*
         * Try bogus drawable
         */
	_hppex_stderr_print("Begin Test 1\n");
	_hppex_test_set_expected_error (X_ERR, BadDrawable,
                                      	PEXRCCreateLookupTable, 0, 0);
	lut = PEXCreateLookupTable (display, 254, PEXLUTColor);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);


	/*
         * Try bogus LUT type
         */
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCCreateLookupTable, 0, 0);
	lut = PEXCreateLookupTable (display, window, 17);

        XSync(display, 0); 
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try unsuppored  LUT type
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCCreateLookupTable, 0, 0);
	lut = PEXCreateLookupTable (display, window, PEXLUTPattern);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 2
     *
     * Copy Lookup Table
     *********************************************************************/
    {

	color_lut = PEXCreateLookupTable (display, window, PEXLUTColor);
	line_lut = PEXCreateLookupTable (display, window, PEXLUTLineBundle);
	str = PEXCreateStructure (display);

	/*
         * Try bogus src ID
         */
	_hppex_stderr_print("Begin Test 2\n");
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCCopyLookupTable, 0, 0);
	PEXCopyLookupTable (display, 34786, line_lut);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try bogus dest ID
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCCopyLookupTable, 0, 0);
	PEXCopyLookupTable (display, color_lut, 374628);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try non-lut src ID
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCCopyLookupTable, 0, 0);
	PEXCopyLookupTable (display, color_lut, str);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try non-lut dest ID
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCCopyLookupTable, 0, 0);
	PEXCopyLookupTable (display, str, line_lut);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try copy of different lut types
         */
	_hppex_test_set_expected_error (X_ERR, BadMatch,
                                      	PEXRCCopyLookupTable, 0, 0);
	PEXCopyLookupTable (display, color_lut, line_lut);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 3
     *
     * Get Table Info
     *********************************************************************/
    {
	/*
         * Try bogus table type
         */
	_hppex_stderr_print("Begin Test 3\n");
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCGetTableInfo, 0, 0);
	status = PEXGetTableInfo (display, window, 42, &table_info);
        XSync(display, 0); 
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try unsupported table type
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCGetTableInfo, 0, 0);
	status = PEXGetTableInfo (display, window, PEXLUTPattern, &table_info);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
   	 * Try a bogus drawable
	 */
	_hppex_test_set_expected_error (X_ERR, BadDrawable,
                                      	PEXRCGetTableInfo, 0, 0);
	status = PEXGetTableInfo (display, 34, PEXLUTColor, &table_info);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

    }
    /**********************************************************************
     * Test 4
     *
     * Get Predefined Entries
     *********************************************************************/
    {
	/*
         * Try bogus table type
         */
	_hppex_stderr_print("Begin Test 4\n");
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCGetPredefinedEntries, 0, 0);
	status = PEXGetPredefinedEntries (display, window, 15, 
					  1,
					  1,
					  &predef_entries);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try unsupported table type
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCGetPredefinedEntries, 0, 0);
	status = PEXGetPredefinedEntries (display, window, PEXLUTPattern, 
					  1,
					  1,
					  &predef_entries);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
   	 * Try a bogus drawable
	 */
	_hppex_test_set_expected_error (X_ERR, BadDrawable,
                                      	PEXRCGetPredefinedEntries, 0, 0);
	status = PEXGetPredefinedEntries (display, 312, PEXLUTColor, 
					  0,
					  8,
					  &predef_entries);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
 	 * Try a bogus start
	 */
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCGetPredefinedEntries, 0, 0);
	status = PEXGetPredefinedEntries (display, window, PEXLUTLineBundle, 
					  0,
					  1,
					  &predef_entries);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
	 * Try a bogus count
	 */
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCGetPredefinedEntries, 0, 0);
	status = PEXGetPredefinedEntries (display, window, PEXLUTColor, 
					  2,
					  9,
					  &predef_entries);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 5
     *
     * Get Defined Indices
     *********************************************************************/
    {
	/*
         * Try bogus table ID
         */
	_hppex_stderr_print("Begin Test 5\n");
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCGetDefinedIndices, 0, 0);
	status = PEXGetDefinedIndices (display, 32314, 
				       &return_count, &return_indices);

        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try non-lut ID
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCGetDefinedIndices, 0, 0);
	status = PEXGetDefinedIndices (display, str, 
				       &return_count, &return_indices);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 6
     *
     * Get Table Entry
     *********************************************************************/
    {
	int status_return, table_type_return;

	/*
         * Try bogus table type
         */
	_hppex_stderr_print("Begin Test 6\n");
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCGetTableEntry, 0, 0);
	predef_entries = PEXGetTableEntry (display, 34098, 1, PEXSetValue,
					   &status_return, &table_type_return);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try non-lut ID
         */
	_hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                      	PEXRCGetTableEntry, 0, 0);
	predef_entries = PEXGetTableEntry (display, str, 1, PEXSetValue,
					   &status_return, &table_type_return);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
         * Try bad index
         */
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCGetTableEntry, 0, 0);
	predef_entries = PEXGetTableEntry (display, line_lut, 0, PEXSetValue,
					   &status_return, &table_type_return);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);

	/*
	 * Try bad value type
 	 */
	_hppex_test_set_expected_error (X_ERR, BadValue,
                                      	PEXRCGetTableEntry, 0, 0);
	predef_entries = PEXGetTableEntry (display, color_lut, 1, 4,
					   &status_return, &table_type_return);
        XSync(display, 0);
	_hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 7
     *
     * Get Table Entries
     *********************************************************************/
    {
        int table_type_return;

        /*
         * Try bogus table type
         */
	_hppex_stderr_print("Begin Test 7\n");
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCGetTableEntries, 0, 0);
        status = PEXGetTableEntries (display, 34098, 1, 1, PEXSetValue,
                                     &table_type_return, &predef_entries);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try non-lut ID
         */
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCGetTableEntries, 0, 0);
        status = PEXGetTableEntries (display, str, 1, 1, PEXSetValue,
                                     &table_type_return, &predef_entries);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try bad start
         */
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCGetTableEntries, 0, 0);
        status = PEXGetTableEntries (display, line_lut, 0, 1, PEXSetValue,
                                     &table_type_return, &predef_entries);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try bad count
         */

        /* Protocol mode does not test for this condition, since it doesn't
         * do error checking.
         */

     
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCGetTableEntries, 0, 0);

       /* Protocol does not do error checking and converts this to 0. */

        status = PEXGetTableEntries (display, line_lut, 1, 65536, PEXSetValue,
                                     &table_type_return, &predef_entries);
        XSync(display, 0);

        if (strcmp("PEX", protocol_mode) != 0) 
           _hppex_test_check_expected_error (err_mask);

        /*
         * Try bad value type
         */
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCGetTableEntries, 0, 0);
        status = PEXGetTableEntries (display, line_lut, 1, 1, 4,
                                     &table_type_return, &predef_entries);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

    }
    /**********************************************************************
     * Test 8
     *
     * Delete Table Entries
     *********************************************************************/
    {
        /*
         * Try bogus table ID
         */
	_hppex_stderr_print("Begin Test 8\n");
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCDeleteTableEntries, 0, 0);
	PEXDeleteTableEntries (display, 738246, 1, 2);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try non-lut ID
         */
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCDeleteTableEntries, 0, 0);
	PEXDeleteTableEntries (display, str, 1, 2);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try bad start
         */
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCDeleteTableEntries, 0, 0);
	PEXDeleteTableEntries (display, line_lut, 0, 1);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try bad count
         */
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCDeleteTableEntries, 0, 0);
	PEXDeleteTableEntries (display, color_lut, 1, 65535);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 9
     *
     * Free Lookup Table 
     *********************************************************************/
    {
        /*
         * Try bogus table ID
         */
	_hppex_stderr_print("Begin Test 9\n");
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCFreeLookupTable, 0, 0);
	PEXFreeLookupTable (display, 837246);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

        /*
         * Try non-lut ID
         */
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCFreeLookupTable, 0, 0);
	PEXFreeLookupTable (display, str);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);
    }
    /**********************************************************************
     * Test 10
     *
     * Set Table Entries
     *********************************************************************/
    {
	LineBundle.type = PEXLineTypeSolid;
	LineBundle.interp_method = PEXPolylineInterpNone;
	LineBundle.curve_approx.method = PEXApproxImpDep;
	LineBundle.curve_approx.tolerance = 1.0;
	LineBundle.width = 1.0;
	LineBundle.color.type = PEXColorTypeIndexed;
	LineBundle.color.value.indexed.index = 2;

        /*
         * Try bogus table ID
         */
	_hppex_stderr_print("Begin Test 10\n");
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, 56478, 1, 1, PEXLUTLineBundle, 
			    &LineBundle);

        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);


        /*
         * Try non-lut ID
         */
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, str, 1, 1, PEXLUTLineBundle, 
			    &LineBundle);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);


        /*
         * Try bogus table type
         */
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, line_lut, 1, 1, 16, 
			    &LineBundle);
        XSync(display, 0); 

       /* This test doesn't work in protocol mode because the server
        * doesn't receive a table type in protocol mode.
        */

        if (strcmp("PEX", protocol_mode) != 0)
           _hppex_test_check_expected_error (err_mask);


        /*
         * Try unsupported table type
         */
        _hppex_test_set_expected_error (PEX_ERR, BadPEXLookupTable,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, line_lut, 1, 1, PEXLUTPattern, 
			    &Pattern);
        XSync(display, 0);
       
       /* This test will fail in protocol mode because the server
        * doesn't get a table type in the request.
        */

        if (strcmp("PEX", protocol_mode) != 0)
           _hppex_test_check_expected_error (err_mask);

	/*
 	 * Try bogus start
         */
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, line_lut, 0, 1, PEXLUTLineBundle, 
			    &LineBundle);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

	/*
	 * Try bogus count
	 */
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, line_lut, 65534, 3, PEXLUTLineBundle, 
			    &LineBundle);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

	/*
	 * Try bogus data in entry
	 */
	LineBundle.interp_method = 4;
        _hppex_test_set_expected_error (X_ERR, BadValue,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, line_lut, 1, 1, PEXLUTLineBundle, 
			    &LineBundle);

        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);

	/*
	 * Try bogus color type
	 */
	LineBundle.interp_method = PEXPolylineInterpNone;
	LineBundle.color.type = PEXColorTypeHSV;
	LineBundle.color.value.hsv.hue = 0.8;
	LineBundle.color.value.hsv.saturation = 0.9;
	LineBundle.color.value.hsv.value = 0.5;
        _hppex_test_set_expected_error (PEX_ERR, BadPEXColorType,
                                        PEXRCSetTableEntries, 0, 0);
	PEXSetTableEntries (display, line_lut, 1, 1, PEXLUTLineBundle, 
			    &LineBundle);
        XSync(display, 0);
        _hppex_test_check_expected_error (err_mask);
    }


    /**********************************************************************
     * Test ends here
     *********************************************************************/
}

void inquire_test_params(char *test_name, 
			 int  *num_images, 
			 int  *supported_modes, 
			 char *win_title)
    {
    strcpy(test_name, "lut_errors");
    *num_images      = 1;
    *supported_modes = NON_OC_MODE;

    strcpy(win_title, "lut_errors");
    }

void misc_setup(Display *dpy, Window window, PEXRenderer renderer,
		int cur_image)
    {
    local_window = window;
    _hppex_set_stderr("lut_errors.stderr", "lut_errors");
    }

void execute_test(Display *dpy, XID resourceID, 
	       PEXOCRequestType req_type, int cur_image)
    {
    describe_test( "\nPEXlib Lookup Table Errors Tests:\n\n" );
    describe_test( "This test contains the following sub-tests:\n");
    describe_test( "  Test  1 PEXCreateLookupTable\n");
    describe_test( "  Test  2 PEXCopyLookupTable\n");
    describe_test( "  Test  3 PEXGetTableInfo\n");
    describe_test( "  Test  4 PEXGetPredefinedEntries\n");
    describe_test( "  Test  5 PEXGetDefinedIndices\n");
    describe_test( "  Test  6 PEXGetTableEntry\n");
    describe_test( "  Test  7 PEXGetTableEntries\n");
    describe_test( "  Test  8 PEXDeleteTableEntries\n");
    describe_test( "  Test  9 PEXFreeLookupTable\n");
    describe_test( "  Test 10 PEXSetTableEntries\n\n");
    describe_test( "This test is successful if no error messages are printed to stderr.\n\n");

    lut_test(dpy, local_window);
    _hppex_close_stderr();
    }

void testproc(Display *dpy, Window window, int cur_image)
    {
    file_testproc("lut_errors.stderr", "lut_errors");
    }