summaryrefslogtreecommitdiff
path: root/xts5/tset/Xopen/XStringToKeysym/TestK.c
blob: 4f51eb1e1f92a0301b3ae2a48aa313a9fba74151 (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
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
/*
Copyright (c) 2005 X.Org Foundation L.L.C.

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/Xopen/XStringToKeysym/TestK.c,v 1.2 2005-11-03 08:44:01 jmichael Exp $
* 
* Project: VSW5
* 
* File: xts5/tset/Xopen/XStringToKeysym/TestK.c
* 
* Description:
* 	Tests for XStringToKeysym()
* 
* Modifications:
* $Log: TestK.c,v $
* Revision 1.2  2005-11-03 08:44:01  jmichael
* clean up all vsw5 paths to use xts5 instead.
*
* Revision 1.1.1.2  2005/04/15 14:05:40  anderson
* Reimport of the base with the legal name in the copyright fixed.
*
* Revision 8.0  1998/12/23 23:35:57  mar
* Branch point for Release 5.0.2
*
* Revision 7.0  1998/10/30 22:58:41  mar
* Branch point for Release 5.0.2b1
*
* Revision 6.0  1998/03/02 05:27:10  tbr
* Branch point for Release 5.0.1
*
* Revision 5.0  1998/01/26 03:23:43  tbr
* Branch point for Release 5.0.1b1
*
* Revision 4.1  1996/05/09 21:19:34  andy
* Fixed X includes
*
* Revision 4.0  1995/12/15  09:14:42  tbr
* Branch point for Release 5.0.0
*
* Revision 3.1  1995/12/15  01:18:08  andy
* Prepare for GA Release
*
*/
/*
 *      SCCS:  @(#)  TestK.c Rel 1.1	    (11/28/91)
 *
 *	UniSoft Ltd., London, England
 *
 * (C) Copyright 1991 X/Open Company Limited
 *
 * All rights reserved.  No part of this source code may be reproduced,
 * stored in a retrieval system, or transmitted, in any form or by any
 * means, electronic, mechanical, photocopying, recording or otherwise,
 * except as stated in the end-user licence agreement, without the prior
 * permission of the copyright owners.
 *
 * X/Open and the 'X' symbol are trademarks of X/Open Company Limited in
 * the UK and other countries.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include        <stdlib.h>
#include        "xtest.h"
#include        "X11/Xlib.h"
#include        "X11/Xutil.h"
#include        "X11/Xresource.h"
#include        "tet_api.h"
#include        "xtestlib.h"
#include        "pixval.h"

extern char	*TestName;

static int
test(symbol, str)
KeySym	symbol;
char	*str;
{
KeySym	rsym;

	rsym = XStringToKeysym(str);

	if(rsym == NoSymbol) {
		report("XStringToKeysym() returned NoSymbol for string \"%s\".", str);
		return(0);
	}

	if(rsym != symbol) {
		report("XStringToKeysym() returned KeySym 0x%lx instead of 0x%lx.", (long) rsym, (long) symbol);
		return(0);
	}
	return(1);
}

static void
reporterr(s)
char	*s;
{
	report("Symbol \"%s\" is not defined.", s);
}
#define XK_KATAKANA
#include	<X11/keysymdef.h>
#undef XK_KATAKANA 

strtsymK()
{ 
int 	pass = 0, fail = 0;
char	*symstr;
KeySym	rsym;


#ifdef XK_overline
	if(test(XK_overline, "overline") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_overline");
	FAIL;
#endif

#ifdef XK_kana_fullstop
	if(test(XK_kana_fullstop, "kana_fullstop") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_fullstop");
	FAIL;
#endif

#ifdef XK_kana_openingbracket
	if(test(XK_kana_openingbracket, "kana_openingbracket") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_openingbracket");
	FAIL;
#endif

#ifdef XK_kana_closingbracket
	if(test(XK_kana_closingbracket, "kana_closingbracket") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_closingbracket");
	FAIL;
#endif

#ifdef XK_kana_comma
	if(test(XK_kana_comma, "kana_comma") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_comma");
	FAIL;
#endif

#ifdef XK_kana_conjunctive
	if(test(XK_kana_conjunctive, "kana_conjunctive") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_conjunctive");
	FAIL;
#endif

#ifdef XK_kana_middledot
	if(test(XK_kana_middledot, "kana_middledot") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_middledot");
	FAIL;
#endif

#ifdef XK_kana_WO
	if(test(XK_kana_WO, "kana_WO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_WO");
	FAIL;
#endif

#ifdef XK_kana_a
	if(test(XK_kana_a, "kana_a") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_a");
	FAIL;
#endif

#ifdef XK_kana_i
	if(test(XK_kana_i, "kana_i") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_i");
	FAIL;
#endif

#ifdef XK_kana_u
	if(test(XK_kana_u, "kana_u") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_u");
	FAIL;
#endif

#ifdef XK_kana_e
	if(test(XK_kana_e, "kana_e") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_e");
	FAIL;
#endif

#ifdef XK_kana_o
	if(test(XK_kana_o, "kana_o") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_o");
	FAIL;
#endif

#ifdef XK_kana_ya
	if(test(XK_kana_ya, "kana_ya") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_ya");
	FAIL;
#endif

#ifdef XK_kana_yu
	if(test(XK_kana_yu, "kana_yu") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_yu");
	FAIL;
#endif

#ifdef XK_kana_yo
	if(test(XK_kana_yo, "kana_yo") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_yo");
	FAIL;
#endif

#ifdef XK_kana_tsu
	if(test(XK_kana_tsu, "kana_tsu") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_tsu");
	FAIL;
#endif

#ifdef XK_kana_tu
	if(test(XK_kana_tu, "kana_tu") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_tu");
	FAIL;
#endif

#ifdef XK_prolongedsound
	if(test(XK_prolongedsound, "prolongedsound") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_prolongedsound");
	FAIL;
#endif

#ifdef XK_kana_A
	if(test(XK_kana_A, "kana_A") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_A");
	FAIL;
#endif

#ifdef XK_kana_I
	if(test(XK_kana_I, "kana_I") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_I");
	FAIL;
#endif

#ifdef XK_kana_U
	if(test(XK_kana_U, "kana_U") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_U");
	FAIL;
#endif

#ifdef XK_kana_E
	if(test(XK_kana_E, "kana_E") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_E");
	FAIL;
#endif

#ifdef XK_kana_O
	if(test(XK_kana_O, "kana_O") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_O");
	FAIL;
#endif

#ifdef XK_kana_KA
	if(test(XK_kana_KA, "kana_KA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_KA");
	FAIL;
#endif

#ifdef XK_kana_KI
	if(test(XK_kana_KI, "kana_KI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_KI");
	FAIL;
#endif

#ifdef XK_kana_KU
	if(test(XK_kana_KU, "kana_KU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_KU");
	FAIL;
#endif

#ifdef XK_kana_KE
	if(test(XK_kana_KE, "kana_KE") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_KE");
	FAIL;
#endif

#ifdef XK_kana_KO
	if(test(XK_kana_KO, "kana_KO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_KO");
	FAIL;
#endif

#ifdef XK_kana_SA
	if(test(XK_kana_SA, "kana_SA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_SA");
	FAIL;
#endif

#ifdef XK_kana_SHI
	if(test(XK_kana_SHI, "kana_SHI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_SHI");
	FAIL;
#endif

#ifdef XK_kana_SU
	if(test(XK_kana_SU, "kana_SU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_SU");
	FAIL;
#endif

#ifdef XK_kana_SE
	if(test(XK_kana_SE, "kana_SE") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_SE");
	FAIL;
#endif

#ifdef XK_kana_SO
	if(test(XK_kana_SO, "kana_SO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_SO");
	FAIL;
#endif

#ifdef XK_kana_TA
	if(test(XK_kana_TA, "kana_TA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_TA");
	FAIL;
#endif

#ifdef XK_kana_CHI
	if(test(XK_kana_CHI, "kana_CHI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_CHI");
	FAIL;
#endif

#ifdef XK_kana_TI
	if(test(XK_kana_TI, "kana_TI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_TI");
	FAIL;
#endif

#ifdef XK_kana_TSU
	if(test(XK_kana_TSU, "kana_TSU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_TSU");
	FAIL;
#endif

#ifdef XK_kana_TU
	if(test(XK_kana_TU, "kana_TU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_TU");
	FAIL;
#endif

#ifdef XK_kana_TE
	if(test(XK_kana_TE, "kana_TE") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_TE");
	FAIL;
#endif

#ifdef XK_kana_TO
	if(test(XK_kana_TO, "kana_TO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_TO");
	FAIL;
#endif

#ifdef XK_kana_NA
	if(test(XK_kana_NA, "kana_NA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_NA");
	FAIL;
#endif

#ifdef XK_kana_NI
	if(test(XK_kana_NI, "kana_NI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_NI");
	FAIL;
#endif

#ifdef XK_kana_NU
	if(test(XK_kana_NU, "kana_NU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_NU");
	FAIL;
#endif

#ifdef XK_kana_NE
	if(test(XK_kana_NE, "kana_NE") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_NE");
	FAIL;
#endif

#ifdef XK_kana_NO
	if(test(XK_kana_NO, "kana_NO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_NO");
	FAIL;
#endif

#ifdef XK_kana_HA
	if(test(XK_kana_HA, "kana_HA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_HA");
	FAIL;
#endif

#ifdef XK_kana_HI
	if(test(XK_kana_HI, "kana_HI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_HI");
	FAIL;
#endif

#ifdef XK_kana_FU
	if(test(XK_kana_FU, "kana_FU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_FU");
	FAIL;
#endif

#ifdef XK_kana_HU
	if(test(XK_kana_HU, "kana_HU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_HU");
	FAIL;
#endif

#ifdef XK_kana_HE
	if(test(XK_kana_HE, "kana_HE") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_HE");
	FAIL;
#endif

#ifdef XK_kana_HO
	if(test(XK_kana_HO, "kana_HO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_HO");
	FAIL;
#endif

#ifdef XK_kana_MA
	if(test(XK_kana_MA, "kana_MA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_MA");
	FAIL;
#endif

#ifdef XK_kana_MI
	if(test(XK_kana_MI, "kana_MI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_MI");
	FAIL;
#endif

#ifdef XK_kana_MU
	if(test(XK_kana_MU, "kana_MU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_MU");
	FAIL;
#endif

#ifdef XK_kana_ME
	if(test(XK_kana_ME, "kana_ME") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_ME");
	FAIL;
#endif

#ifdef XK_kana_MO
	if(test(XK_kana_MO, "kana_MO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_MO");
	FAIL;
#endif

#ifdef XK_kana_YA
	if(test(XK_kana_YA, "kana_YA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_YA");
	FAIL;
#endif

#ifdef XK_kana_YU
	if(test(XK_kana_YU, "kana_YU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_YU");
	FAIL;
#endif

#ifdef XK_kana_YO
	if(test(XK_kana_YO, "kana_YO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_YO");
	FAIL;
#endif

#ifdef XK_kana_RA
	if(test(XK_kana_RA, "kana_RA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_RA");
	FAIL;
#endif

#ifdef XK_kana_RI
	if(test(XK_kana_RI, "kana_RI") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_RI");
	FAIL;
#endif

#ifdef XK_kana_RU
	if(test(XK_kana_RU, "kana_RU") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_RU");
	FAIL;
#endif

#ifdef XK_kana_RE
	if(test(XK_kana_RE, "kana_RE") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_RE");
	FAIL;
#endif

#ifdef XK_kana_RO
	if(test(XK_kana_RO, "kana_RO") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_RO");
	FAIL;
#endif

#ifdef XK_kana_WA
	if(test(XK_kana_WA, "kana_WA") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_WA");
	FAIL;
#endif

#ifdef XK_kana_N
	if(test(XK_kana_N, "kana_N") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_N");
	FAIL;
#endif

#ifdef XK_voicedsound
	if(test(XK_voicedsound, "voicedsound") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_voicedsound");
	FAIL;
#endif

#ifdef XK_semivoicedsound
	if(test(XK_semivoicedsound, "semivoicedsound") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_semivoicedsound");
	FAIL;
#endif

#ifdef XK_kana_switch
	if(test(XK_kana_switch, "kana_switch") == 1)
		CHECK;
	else
		FAIL;
#else
	reporterr("XK_kana_switch");
	FAIL;
#endif

	CHECKPASS(70);
}