summaryrefslogtreecommitdiff
path: root/tests/lib/libcurses/t_curses.sh
blob: c8eb6bfbccea9acd8974f7b4be9be64e55d0c05a (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
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
h_run()
{
	TEST_LOCALE=en_US.UTF-8

	file=$1
	locale=`locale -a | grep -i ${TEST_LOCALE}`
	if [ -z "${locale}" ]; then
		atf_fail "test ${file} failed because locale ${locale} not available"
	else
		# export the locale and shift the parameters by two and pass the rest
		export LC_ALL=$locale
		shift
		r_run $file $@
	fi
}

r_run()
{
	file="$(atf_get_srcdir)/tests/${1}"
	export COLUMNS=80
	export LINES=24
	$(atf_get_srcdir)/director $2 \
		-T $(atf_get_srcdir) \
		-t atf \
		-C $(atf_get_srcdir)/check_files \
		-s $(atf_get_srcdir)/slave $file || atf_fail "test ${file} failed"
}

##########################################
# testframe utility functions
##########################################

atf_test_case startup
startup_head()
{
	atf_set "descr" "Checks curses initialisation sequence"
}
startup_body()
{
	h_run start
}

atf_test_case window
window_head()
{
	atf_set "descr" "Checks window creation"
}
window_body()
{
	h_run window
}

atf_test_case start_slk
start_slk_head()
{
	atf_set "descr" "Checks curses initialisation sequence with soft key labels"
}
start_slk_body()
{
	h_run start_slk
}

atf_test_case window_hierarchy
window_hierarchy_head()
{
	atf_set "descr" "Checks creating a hierarchy of windows"
}
window_hierarchy_body()
{
	h_run window_hierarchy
}

atf_test_case two_window
two_window_head()
{
	atf_set "descr" "Checks creating 2 windows"
}
two_window_body()
{
	h_run two_window
}

atf_test_case varcheck
varcheck_head()
{
	atf_set "descr" "Checks if the testframe CHECK command works"
}
varcheck_body()
{
	h_run varcheck
}

##########################################
# curses add characters to window routines
##########################################

atf_test_case addbytes
addbytes_head()
{
	atf_set "descr" "Tests adding bytes to stdscr"
}
addbytes_body()
{
	h_run addbytes
}

atf_test_case addch
addch_head()
{
	atf_set "descr" "Tests adding a chtype to stdscr"
}
addch_body()
{
	h_run addch
}

atf_test_case waddch
waddch_head()
{
    atf_set "descr" "Tests adding a chtype to window - tests mvwaddch too"
}
waddch_body()
{
    h_run waddch
}

atf_test_case mvaddch
mvaddch_head()
{
	atf_set "descr" "Move the cursor and add a character to stdscr"
}
mvaddch_body()
{
	h_run mvaddch
}

atf_test_case addchstr
addchstr_head()
{
	atf_set "descr" "Tests adding a chtype string to stdscr"
}
addchstr_body()
{
	h_run addchstr
}

atf_test_case waddchstr
waddchstr_head()
{
    atf_set "descr" "Tests adding a chtype string to window"
}
waddchstr_body()
{
    h_run waddchstr
}

atf_test_case addchnstr
addchnstr_head()
{
	atf_set "descr" "Tests adding bytes from a chtype string to stdscr"
}
addchnstr_body()
{
	h_run addchnstr
}

atf_test_case waddchnstr
waddchnstr_head()
{
    atf_set "descr" "Tests adding bytes from a chtype string to window"
}
waddchnstr_body()
{
    h_run waddchnstr
}

atf_test_case mvaddchstr
mvaddchstr_head()
{
	atf_set "descr" "Move the cursor and add a ch string to stdscr"
}
mvaddchstr_body()
{
	h_run mvaddchstr
}

atf_test_case mvwaddchstr
mvwaddchstr_head()
{
    atf_set "descr" "Move the cursor and add a ch string to window"
}
mvwaddchstr_body()
{
    h_run mvwaddchstr
}

atf_test_case mvaddchnstr
mvaddchnstr_head()
{
	atf_set "descr" "Move the cursor and add a limited ch string to stdscr"
}
mvaddchnstr_body()
{
	h_run mvaddchnstr
}

atf_test_case mvwaddchnstr
mvwaddchnstr_head()
{
    atf_set "descr" "Move the cursor and add a limited ch string to window"
}
mvwaddchnstr_body()
{
    h_run mvwaddchnstr
}

atf_test_case addstr
addstr_head()
{
	atf_set "descr" "Tests adding bytes from a string to stdscr"
}
addstr_body()
{
	h_run addstr
}

atf_test_case addwstr
addwstr_head()
{
    atf_set "descr" "Tests adding wide character string to stdscr"
}
addwstr_body()
{
    h_run addwstr
}

atf_test_case waddstr
waddstr_head()
{
    atf_set "descr" "Tests adding bytes from a string to window"
}
waddstr_body()
{
    h_run waddstr
}

atf_test_case waddwstr
waddwstr_head()
{
    atf_set "descr" "Tests adding wide character string to window"
}
waddwstr_body()
{
    h_run waddwstr
}

atf_test_case addnstr
addnstr_head()
{
	atf_set "descr" "Tests adding bytes from a string to stdscr"
}
addnstr_body()
{
	h_run addnstr
}

atf_test_case addnwstr
addnwstr_head()
{
    atf_set "descr" "Tests adding wide characters from string to stdscr"
}
addnwstr_body()
{
    h_run addnwstr
}

atf_test_case waddnstr
waddnstr_head()
{
    atf_set "descr" "Tests adding wide characters from string to window"
}
waddnstr_body()
{
    h_run waddnstr
}

atf_test_case waddnwstr
waddnwstr_head()
{
    atf_set "descr" "Move the cursor and add wide characters from string to stdscr"
}
waddnwstr_body()
{
    h_run waddnwstr
}

atf_test_case mvwaddnwstr
mvwaddnwstr_head()
{
    atf_set "descr" "Move the cursor and add wide characters from string to stdscr"
}
mvwaddnwstr_body()
{
    h_run mvwaddnwstr
}

atf_test_case mvaddstr
mvaddstr_head()
{
	atf_set "descr" "Move the cursor and add a string to stdscr"
}
mvaddstr_body()
{
	h_run mvaddstr
}

atf_test_case mvaddwstr
mvaddwstr_head()
{
    atf_set "descr" "Move the cursor and add wide character string to stdscr"
}
mvaddwstr_body()
{
    h_run mvaddwstr
}

atf_test_case mvwaddwstr
mvwaddwstr_head()
{
    atf_set "descr" "Move the cursor and add wide character string to window"
}
mvwaddwstr_body()
{
    h_run mvwaddwstr
}

atf_test_case mvwaddstr
mvwaddstr_head()
{
    atf_set "descr" "Move the cursor and add a string to window"
}
mvwaddstr_body()
{
    h_run mvwaddstr
}

atf_test_case mvaddnstr
mvaddnstr_head()
{
	atf_set "descr" "Move the cursor and add a limited string to stdscr"
}
mvaddnstr_body()
{
	h_run mvaddnstr
}

atf_test_case mvaddnwstr
mvaddnwstr_head()
{
    atf_set "descr" "Move the cursor and add wide characters from string to stdscr"
}
mvaddnwstr_body()
{
    h_run mvaddnwstr
}

atf_test_case mvwaddnstr
mvwaddnstr_head()
{
    atf_set "descr" "Move the cursor and add wide characters from string to window"
}
mvwaddnstr_body()
{
    h_run mvwaddnstr
}

atf_test_case add_wch
add_wch_head()
{
	atf_set "descr" "Test adding complex character to stdscr"
}
add_wch_body()
{
	h_run add_wch
}

atf_test_case wadd_wch
wadd_wch_head()
{
    atf_set "descr" "Test adding complex character to window"
}
wadd_wch_body()
{
    h_run wadd_wch
}

##########################################
# curses input stream routines
##########################################

atf_test_case getch
getch_head()
{
	atf_set "descr" "Checks reading a character input - tests mvgetch also"
}
getch_body()
{
	h_run getch
}

atf_test_case wgetch
wgetch_head()
{
	atf_set "descr" "Checks reading a character input from window - tests mvwgetch also"
}
wgetch_body()
{
	h_run wgetch
}

atf_test_case define_key
define_key_head()
{
	atf_set "descr" "Check defining a key and removing the definition works"
}
define_key_body()
{
	h_run define_key
}

atf_test_case keyok
keyok_head()
{
	atf_set "descr" "Check the ability to disable interpretation of a multichar key sequence"
}
keyok_body()
{
	h_run keyok
}

atf_test_case getnstr
getnstr_head()
{
	atf_set "descr" "Check getting a string with a limit"
}
getnstr_body()
{
	h_run getnstr
}

atf_test_case wgetnstr
wgetnstr_head()
{
    atf_set "descr" "Check getting a string on window input with a limit"
}
wgetnstr_body()
{
    h_run wgetnstr
}

atf_test_case mvgetnstr
mvgetnstr_head()
{
	atf_set "descr" "Move the cursor and get a limited number of characters"
}
mvgetnstr_body()
{
	h_run mvgetnstr
}

atf_test_case mvwgetnstr
mvwgetnstr_head()
{
    atf_set "descr" "Move the cursor and get a limited number of characters on window input"
}
mvwgetnstr_body()
{
    h_run mvwgetnstr
}

atf_test_case getstr
getstr_head()
{
	atf_set "descr" "Check getting a string from input"
}
getstr_body()
{
	h_run getstr
}

atf_test_case wgetstr
wgetstr_head()
{
    atf_set "descr" "Check getting a string from window input"
}
wgetstr_body()
{
    h_run wgetstr
}

atf_test_case mvgetstr
mvgetstr_head()
{
	atf_set "descr" "Move the cursor and get characters"
}
mvgetstr_body()
{
	h_run mvgetstr
}

atf_test_case mvwgetstr
mvwgetstr_head()
{
    atf_set "descr" "Move the cursor and get characters on window input"
}
mvwgetstr_body()
{
    h_run mvwgetstr
}

atf_test_case keyname
keyname_head()
{
	atf_set "descr" "Convert integers into printable key names"
}
keyname_body()
{
	h_run keyname
}

atf_test_case key_name
key_name_head()
{
    atf_set "descr" "Convert integers into printable key names"
}
key_name_body()
{
    h_run key_name
}

atf_test_case keypad
keypad_head()
{
    atf_set "descr" "Checks enable/disable abbreviation of function keys - tests is_keypad also"
}
keypad_body()
{
    h_run keypad
}

atf_test_case notimeout
notimeout_head()
{
    atf_set "descr" "Checks notimeout when reading a character"
}
notimeout_body()
{
    h_run notimeout
}

atf_test_case timeout
timeout_head()
{
	atf_set "descr" "Checks timeout when reading a character"
}
timeout_body()
{
	h_run timeout
}

atf_test_case wtimeout
wtimeout_head()
{
    atf_set "descr" "Checks timeout when reading a character on window"
}
wtimeout_body()
{
    h_run wtimeout
}

atf_test_case nodelay
nodelay_head()
{
	atf_set "descr" "Test that the nodelay call causes wget to not block"
}
nodelay_body()
{
	h_run nodelay
}

atf_test_case unget_wch
unget_wch_head()
{
    atf_set "descr" "Checks pushing of character into input queue - tests ungetch also"
}
unget_wch_body()
{
    h_run unget_wch
}

atf_test_case getn_wstr
getn_wstr_head()
{
    atf_set "descr" "Checks getting limited characters from wide string through queue"
}
getn_wstr_body()
{
    h_run getn_wstr
}

atf_test_case wgetn_wstr
wgetn_wstr_head()
{
    atf_set "descr" "Checks getting limited characters from wide string on window through queue"
}
wgetn_wstr_body()
{
    h_run wgetn_wstr
}

atf_test_case get_wstr
get_wstr_head()
{
    atf_set "descr" "Checks getting characters from wide string through queue"
}
get_wstr_body()
{
    h_run get_wstr
}

atf_test_case wget_wstr
wget_wstr_head()
{
    atf_set "descr" "Checks getting characters from wide string on window through queue"
}
wget_wstr_body()
{
    h_run wget_wstr
}

atf_test_case mvgetn_wstr
mvgetn_wstr_head()
{
    atf_set "descr" "Move the cursor and get limited characters from wide string through queue"
}
mvgetn_wstr_body()
{
    h_run mvgetn_wstr
}

atf_test_case mvwgetn_wstr
mvwgetn_wstr_head()
{
    atf_set "descr" "Move the cursor and get limited characters from wide string on window through queue"
}
mvwgetn_wstr_body()
{
    h_run mvwgetn_wstr
}

atf_test_case mvget_wstr
mvget_wstr_head()
{
    atf_set "descr" "Move the cursor and get characters from wide string through queue"
}
mvget_wstr_body()
{
    h_run mvget_wstr
}

atf_test_case mvwget_wstr
mvwget_wstr_head()
{
    atf_set "descr" "Move the cursor and get characters from wide string on window through queue"
}
mvwget_wstr_body()
{
    h_run mvwget_wstr
}

atf_test_case get_wch
get_wch_head()
{
	atf_set "descr" "Checks reading a complex character through input queue"
}
get_wch_body()
{
	h_run get_wch
}

##########################################
# curses read screen contents routines
##########################################

atf_test_case inch
inch_head()
{
	atf_set "descr" "Get the character under the cursor on stdscr"
}
inch_body()
{
	h_run inch
}

atf_test_case winch
winch_head()
{
    atf_set "descr" "Get the character under the cursor on window"
}
winch_body()
{
    h_run winch
}

atf_test_case mvinch
mvinch_head()
{
	atf_set "descr" "Move the cursor and get the character under the cursor on stdscr"
}
mvinch_body()
{
	h_run mvinch
}

atf_test_case mvwinch
mvwinch_head()
{
    atf_set "descr" "Move the cursor and get the character under the cursor on window"
}
mvwinch_body()
{
    h_run mvwinch
}

atf_test_case inchnstr
inchnstr_head()
{
	atf_set "descr" "Get a limited chtype string from the stdscr - tests inchstr too"
}
inchnstr_body()
{
	h_run inchnstr
}

atf_test_case winchnstr
winchnstr_head()
{
    atf_set "descr" "Get a limited chtype string from the window - tests winchstr too"
}
winchnstr_body()
{
    h_run winchnstr
}

atf_test_case mvinchnstr
mvinchnstr_head()
{
	atf_set "descr" "Move the cursor read characters from stdscr - tests both mvinchstr and mvinchnstr"
}
mvinchnstr_body()
{
	h_run mvinchnstr
}

atf_test_case mvwinchnstr
mvwinchnstr_head()
{
    atf_set "descr" "Move the cursor read characters from window - tests both mvinchstr and mvinchnstr"
}
mvwinchnstr_body()
{
    h_run mvwinchnstr
}

atf_test_case innstr
innstr_head()
{
	atf_set "descr" "Get a limited string starting at the cursor from stdscr - tests instr also"
}
innstr_body()
{
	h_run innstr
}

atf_test_case winnstr
winnstr_head()
{
    atf_set "descr" "Get a limited string starting at the cursor from window - tests instr also"
}
winnstr_body()
{
    h_run winnstr
}

atf_test_case mvinnstr
mvinnstr_head()
{
    atf_set "descr" "Move the cursor read limited characters from stdscr - tests mvinstr also"
}
mvinnstr_body()
{
    h_run mvinnstr
}

atf_test_case mvwinnstr
mvwinnstr_head()
{
    atf_set "descr" "Move the cursor read limited characters from window - tests mvwinstr also"
}
mvwinnstr_body()
{
    h_run mvwinnstr
}

atf_test_case in_wch
in_wch_head()
{
    atf_set "descr" "Read the complex character from stdscr - tests mvin_wch too"
}
in_wch_body()
{
    h_run in_wch
}

atf_test_case win_wch
win_wch_head()
{
    atf_set "descr" "Read the complex character from window - tests mvwin_wch too"
}
win_wch_body()
{
    h_run win_wch
}

atf_test_case innwstr
innwstr_head()
{
    atf_set "descr" "Get a limited wide string starting at the cursor from stdscr"
}
innwstr_body()
{
    h_run innwstr
}

atf_test_case winnwstr
winnwstr_head()
{
    atf_set "descr" "Get a limited wide string starting at the cursor from window"
}
winnwstr_body()
{
    h_run winnwstr
}

atf_test_case inwstr
inwstr_head()
{
    atf_set "descr" "Get a wide string starting at the cursor from stdscr"
}
inwstr_body()
{
    h_run inwstr
}

atf_test_case winwstr
winwstr_head()
{
    atf_set "descr" "Get a wide string starting at the cursor from window"
}
winwstr_body()
{
    h_run winwstr
}

atf_test_case mvinnwstr
mvinnwstr_head()
{
    atf_set "descr" "Move the cursor and get a limited wide string starting at the cursor from stdscr"
}
mvinnwstr_body()
{
    h_run mvinnwstr
}

atf_test_case mvwinnwstr
mvwinnwstr_head()
{
    atf_set "descr" "Move the cursor and get a limited wide string starting at the cursor from window"
}
mvwinnwstr_body()
{
    h_run mvwinnwstr
}

atf_test_case mvinwstr
mvinwstr_head()
{
    atf_set "descr" "Move the cursor and get a wide string starting at the cursor from stdscr"
}
mvinwstr_body()
{
    h_run mvinwstr
}

atf_test_case mvwinwstr
mvwinwstr_head()
{
    atf_set "descr" "Move the cursor and get a limited wide string starting at the cursor from window"
}
mvwinwstr_body()
{
    h_run mvwinwstr
}

##########################################
# curses insert character to window routines
##########################################

atf_test_case insch
insch_head()
{
    atf_set "descr" "Tests inserting a chtype to stdscr"
}
insch_body()
{
    h_run insch
}

atf_test_case winsch
winsch_head()
{
    atf_set "descr" "Tests inserting a chtype to window"
}
winsch_body()
{
    h_run winsch
}

atf_test_case mvinsch
mvinsch_head()
{
    atf_set "descr" "Move the cursor and insert a chtype to stdscr"
}
mvinsch_body()
{
    h_run mvinsch
}

atf_test_case mvwinsch
mvwinsch_head()
{
    atf_set "descr" "Move the cursor and insert a chtype to window"
}
mvwinsch_body()
{
    h_run mvwinsch
}

atf_test_case ins_wch
ins_wch_head()
{
    atf_set "descr" "Tests inserting complex character to stdscr"
}
ins_wch_body()
{
    h_run ins_wch
}

atf_test_case wins_wch
wins_wch_head()
{
    atf_set "descr" "Tests inserting complex character to window"
}
wins_wch_body()
{
    h_run wins_wch
}

atf_test_case mvins_wch
mvins_wch_head()
{
    atf_set "descr" "Move the cursor and insert complex character to stdscr"
}
mvins_wch_body()
{
    h_run mvins_wch
}

atf_test_case mvwins_wch
mvwins_wch_head()
{
    atf_set "descr" "Move the cursor and insert complex character to window"
}
mvwins_wch_body()
{
    h_run mvwins_wch
}

atf_test_case ins_nwstr
ins_nwstr_head()
{
    atf_set "descr" "Tests inserting a limited wide character string to stdscr"
}
ins_nwstr_body()
{
    h_run ins_nwstr
}

atf_test_case wins_nwstr
wins_nwstr_head()
{
    atf_set "descr" "Tests inserting a limited wide character string to window"
}
wins_nwstr_body()
{
    h_run wins_nwstr
}

atf_test_case ins_wstr
ins_wstr_head()
{
    atf_set "descr" "Tests inserting a wide character string to stdscr"
}
ins_wstr_body()
{
    h_run ins_wstr
}

atf_test_case wins_wstr
wins_wstr_head()
{
    atf_set "descr" "Tests inserting a wide character string to window"
}
wins_wstr_body()
{
    h_run wins_wstr
}

atf_test_case mvins_nwstr
mvins_nwstr_head()
{
    atf_set "descr" "Move the cursor and insert a limited wide character string to stdscr"
}
mvins_nwstr_body()
{
    h_run mvins_nwstr
}

atf_test_case mvwins_nwstr
mvwins_nwstr_head()
{
    atf_set "descr" "Move the cursor and insert a limited wide character string to window"
}
mvwins_nwstr_body()
{
    h_run mvwins_nwstr
}

atf_test_case mvins_wstr
mvins_wstr_head()
{
    atf_set "descr" "Move the cursor and insert a wide character string to stdscr"
}
mvins_wstr_body()
{
    h_run mvins_wstr
}

atf_test_case mvwins_wstr
mvwins_wstr_head()
{
    atf_set "descr" "Move the cursor and insert a wide character string to window"
}
mvwins_wstr_body()
{
    h_run mvwins_wstr
}

##########################################
# curses delete characters routines
##########################################

atf_test_case delch
delch_head()
{
    atf_set "descr" "Tests deleting a character from stdscr and window both"
}
delch_body()
{
    h_run delch
}

atf_test_case mvdelch
mvdelch_head()
{
    atf_set "descr" "Move the cursor, deletes the character from stdscr and window"
}
mvdelch_body()
{
    h_run mvdelch
}

##########################################
# curses terminal manipulation routines
##########################################

atf_test_case beep
beep_head()
{
	atf_set "descr" "Check sending a beep"
}
beep_body()
{
	h_run beep
}

atf_test_case flash
flash_head()
{
	atf_set "descr" "Validate curses can flash the screen"
}
flash_body()
{
	h_run flash
}

atf_test_case curs_set
curs_set_head()
{
	atf_set "descr" "Check setting the cursor visibility works"
}
curs_set_body()
{
	h_run curs_set
}

atf_test_case delay_output
delay_output_head()
{
    atf_set "descr" "Tests pausing the output"
}
delay_output_body()
{
    h_run delay_output
}

atf_test_case erasechar
erasechar_head()
{
	atf_set "descr" "Validate erase char can be retrieved"
}
erasechar_body()
{
	h_run erasechar
}

atf_test_case erasewchar
erasewchar_head()
{
    atf_set "descr" "Validate erase wide char can be retrieved"
}
erasewchar_body()
{
    h_run erasewchar
}

atf_test_case echochar
echochar_head()
{
    atf_set "descr" "echo single-byte character and rendition to a stdscr/window and refresh"
}
echochar_body()
{
    h_run echochar
}

atf_test_case echo_wchar
echo_wchar_head()
{
    atf_set "descr" "echo wide character and rendition to a stdscr and refresh"
}
echo_wchar_body()
{
    h_run echo_wchar
}

atf_test_case wecho_wchar
wecho_wchar_head()
{
    atf_set "descr" "echo wide character and rendition to a window and refresh"
}
wecho_wchar_body()
{
    h_run wecho_wchar
}

atf_test_case halfdelay
halfdelay_head()
{
    atf_set "descr" "Tests setting the input mode to half delay"
}
halfdelay_body()
{
    h_run halfdelay
}

atf_test_case has_ic
has_ic_head()
{
	atf_set "descr" "Check if the terminal can insert characters and lines"
}
has_ic_body()
{
	h_run has_ic
}

atf_test_case killchar
killchar_head()
{
	atf_set "descr" "Get the value of the terminals kill character"
}
killchar_body()
{
	h_run killchar
}

atf_test_case killwchar
killwchar_head()
{
    atf_set "descr" "Get the value of the terminals wide kill character"
}
killwchar_body()
{
    h_run killwchar
}

atf_test_case meta
meta_head()
{
	atf_set "descr" "Check setting and clearing the meta flag on a window"
}
meta_body()
{
	h_run meta
}

atf_test_case cbreak
cbreak_head()
{
	atf_set "descr" "Check cbreak mode works"
}
cbreak_body()
{
	h_run cbreak
}

atf_test_case nocbreak
nocbreak_head()
{
	atf_set "descr" "Test that the nocbreak call returns the terminal to canonical character processing"
}
nocbreak_body()
{
	h_run nocbreak
}

##########################################
# curses general attribute manipulation routines
##########################################

atf_test_case attributes
attributes_head()
{
	atf_set "descr" "Check setting, clearing and getting of attributes of stdscr"
}
attributes_body()
{
	h_run attributes
}

atf_test_case wattributes
wattributes_head()
{
    atf_set "descr" "Check setting, clearing and getting of attributes of window"
}
wattributes_body()
{
    h_run wattributes
}

atf_test_case getattrs
getattrs_head()
{
	atf_set "descr" "Validate curses can get and set attributes on a window"
}
getattrs_body()
{
	h_run getattrs
}

atf_test_case color_set
color_set_head()
{
    atf_set "descr" "Validate curses can set the color pair for stdscr"
}
color_set_body()
{
    h_run color_set
}

atf_test_case wcolor_set
wcolor_set_head()
{
    atf_set "descr" "Validate curses can set the color pair for window"
}
wcolor_set_body()
{
    h_run wcolor_set
}

atf_test_case termattrs
termattrs_head()
{
	atf_set "descr" "Check the terminal attributes"
}
termattrs_body()
{
	h_run termattrs
}

##########################################
# curses on-screen attribute manipulation routines
##########################################

atf_test_case chgat
chgat_head()
{
	atf_set "descr" "Check changing attributes works on stdscr"
}
chgat_body()
{
	h_run chgat
}

atf_test_case wchgat
wchgat_head()
{
    atf_set "descr" "Check changing attributes works on window"
}
wchgat_body()
{
    h_run wchgat
}

atf_test_case mvchgat
mvchgat_head()
{
	atf_set "descr" "Move the cursor and change the attributes on the screen"
}
mvchgat_body()
{
	h_run mvchgat
}

atf_test_case mvwchgat
mvwchgat_head()
{
    atf_set "descr" "Move the cursor and change the attributes on the window"
}
mvwchgat_body()
{
    h_run mvwchgat
}

##########################################
# curses standout attribute manipulation routines
##########################################

atf_test_case standout
standout_head()
{
    atf_set "descr" "Checks tuning on/off of standard attribute on stdscr"
}
standout_body()
{
    h_run standout
}

atf_test_case wstandout
wstandout_head()
{
    atf_set "descr" "Checks tuning on/off of standard attribute on window"
}
wstandout_body()
{
    h_run wstandout
}

##########################################
# curses color manipulation routines
##########################################

atf_test_case has_colors
has_colors_head()
{
	atf_set "descr" "Check if the terminal can support colours"
}
has_colors_body()
{
	h_run has_colors
}

atf_test_case can_change_color
can_change_color_head()
{
	atf_set "descr" "Check if the terminal can change colours"
}
can_change_color_body()
{
	h_run can_change_color
}

atf_test_case start_color
start_color_head()
{
    atf_set "descr" "Check if curses can enable use of colours"
}
start_color_body()
{
    h_run start_color
}

atf_test_case pair_content
pair_content_head()
{
    atf_set "descr" "Checks color pair initialization and retrieval"
}
pair_content_body()
{
    h_run pair_content
}

atf_test_case init_color
init_color_head()
{
	atf_set "descr" "Set a custom color entry"
}
init_color_body()
{
	h_run init_color
}

atf_test_case color_content
color_content_head()
{
    atf_set "descr" "Check if curses can extract the color intensity from colors"
}
color_content_body()
{
    h_run color_content
}

atf_test_case assume_default_colors
assume_default_colors_head()
{
	atf_set "descr" "Check setting the default color pair"
}
assume_default_colors_body()
{
	h_run assume_default_colors
}

##########################################
# curses clear window routines
##########################################

atf_test_case clear
clear_head()
{
	atf_set "descr" "Check clear,erase,clrtobot,clrtoeol work - tests window routines too"
}
clear_body()
{
	h_run clear
}

atf_test_case clearok
clearok_head()
{
    atf_set "descr" "Check clearing of screen during a refresh if correspnding flag is set"
}
clearok_body()
{
    h_run clearok
}

##########################################
# curses terminal update routines
##########################################

atf_test_case doupdate
doupdate_head()
{
	atf_set "descr" "Check doupdate performs an update - test wnoutrefresh too"
}
doupdate_body()
{
	h_run doupdate
}

atf_test_case immedok
immedok_head()
{
    atf_set "descr" "Checks if the screen is refreshed whenever window is changed"
}
immedok_body()
{
    h_run immedok
}

atf_test_case leaveok
leaveok_head()
{
    atf_set "descr" "Checks cursor positioning from refresh operations - tests is_leaveok too"
}
leaveok_body()
{
    h_run leaveok
}

##########################################
# curses window scrolling routines
##########################################

atf_test_case wscrl
wscrl_head()
{
	atf_set "descr" "Check window scrolling"
}
wscrl_body()
{
	h_run wscrl
}

atf_test_case scroll
scroll_head()
{
    atf_set "descr" "Checks scrolling"
}
scroll_body()
{
    h_run scroll
}

atf_test_case setscrreg
setscrreg_head()
{
    atf_set "descr" "Checks if setting the scrolling region works for stdscr"
}
setscrreg_body()
{
    h_run setscrreg
}

atf_test_case wsetscrreg
wsetscrreg_head()
{
    atf_set "descr" "Checks if setting the scrolling region works for window"
}
wsetscrreg_body()
{
    h_run wsetscrreg
}

##########################################
# curses window modification routines
##########################################

atf_test_case touchline
touchline_head()
{
    atf_set "descr" "Checks touchline to touch lines"
}
touchline_body()
{
    h_run touchline
}

atf_test_case touchoverlap
touchoverlap_head()
{
    atf_set "descr" "Check touching of partial and full overlap of windows"
}
touchoverlap_body()
{
    h_run touchoverlap
}

atf_test_case touchwin
touchwin_head()
{
    atf_set "descr" "Tests touching of window to completely refresh it"
}
touchwin_body()
{
    h_run touchwin
}

atf_test_case untouchwin
untouchwin_head()
{
    atf_set "descr" "Tests untouching the changes made to window so they are not reflected in refresh"
}
untouchwin_body()
{
    h_run untouchwin
}

atf_test_case wtouchln
wtouchln_head()
{
    atf_set "descr" "Tests touching of multiple lines in window"
}
wtouchln_body()
{
    h_run wtouchln
}

atf_test_case is_linetouched
is_linetouched_head()
{
	atf_set "descr" "Check if a line has been modified in a window"
}
is_linetouched_body()
{
	h_run is_linetouched
}

atf_test_case is_wintouched
is_wintouched_head()
{
	atf_set "descr" "Check if a window has been modified"
}
is_wintouched_body()
{
	h_run is_wintouched
}

atf_test_case redrawwin
redrawwin_head()
{
    atf_set "descr" "Tests marking whole window as touched and redraw it"
}
redrawwin_body()
{
    h_run redrawwin
}

atf_test_case wredrawln
wredrawln_head()
{
    atf_set "descr" "Tests marking line in window as touched and redraw it"
}
wredrawln_body()
{
    h_run wredrawln
}

atf_test_case wresize
wresize_head()
{
    atf_set "descr" "Tests resizing a window with a subwin"
}
wresize_body()
{
    h_run wresize
}

##########################################
# curses soft label key routines
##########################################

atf_test_case slk
slk_head()
{
    atf_set "descr" "Tests routines related to soft key labels"
}
slk_body()
{
    h_run slk
}

##########################################
# curses draw lines on windows routines
##########################################

atf_test_case hline
hline_head()
{
	atf_set "descr" "Draw a horizontal line on stdscr"
}
hline_body()
{
	h_run hline
}

atf_test_case whline
whline_head()
{
    atf_set "descr" "Draw a horizontal line on window - tests mvwhline too"
}
whline_body()
{
    h_run whline
}

atf_test_case mvhline
mvhline_head()
{
	atf_set "descr" "Move the cursor and draw a horizontal line"
}
mvhline_body()
{
	h_run mvhline
}

atf_test_case wvline
wvline_head()
{
    atf_set "descr" "Draw a vertical line on window - tests mvwvline too"
}
wvline_body()
{
    h_run wvline
}

atf_test_case mvvline
mvvline_head()
{
	atf_set "descr" "Move the cursor and draw a vertical line - tests vline too"
}
mvvline_body()
{
	h_run mvvline
}

atf_test_case hline_set
hline_set_head()
{
    atf_set "descr" "Draws a horizontal line on stdscr using complex character"
}
hline_set_body()
{
    h_run hline_set
}

atf_test_case whline_set
whline_set_head()
{
    atf_set "descr" "Draws a horizontal line on window using complex character"
}
whline_set_body()
{
    h_run whline_set
}

atf_test_case vline_set
vline_set_head()
{
    atf_set "descr" "Draws a vertical line on stdscr using complex character"
}
vline_set_body()
{
    h_run vline_set
}

atf_test_case wvline_set
wvline_set_head()
{
    atf_set "descr" "Draws a vertical line on window using complex character"
}
wvline_set_body()
{
    h_run wvline_set
}

##########################################
# curses pad routines
##########################################

atf_test_case pad
pad_head()
{
	atf_set "descr" "Test the newpad, subpad, pnoutrefresh and prefresh functions"
}
pad_body()
{
	h_run pad
}

atf_test_case pechochar
pechochar_head()
{
    atf_set "descr" "Tests pechochar and pecho_wchar functions"
}
pechochar_body()
{
    h_run pechochar
}

##########################################
# curses cursor and window location and positioning routines
##########################################

atf_test_case cursor
cursor_head()
{
    atf_set "descr" "Tests cursor positioning and window location routines"
}
cursor_body()
{
    h_run cursor
}

atf_test_case getcurx
getcurx_head()
{
	atf_set "descr" "Validate curses getting cursor locations in a window"
}
getcurx_body()
{
	h_run getcurx
}

atf_test_case getmaxx
getmaxx_head()
{
	atf_set "descr" "Validate curses getting the maximum x value of a window"
}
getmaxx_body()
{
	h_run getmaxx
}

atf_test_case getmaxy
getmaxy_head()
{
	atf_set "descr" "Validate curses getting the maximum y value of a window"
}
getmaxy_body()
{
	h_run getmaxy
}

atf_test_case getparx
getparx_head()
{
	atf_set "descr" "Check getting the location of a window relative to its parent"
}
getparx_body()
{
	h_run getparx
}

atf_test_case getbegy
getbegy_head()
{
	atf_set "descr" "Validate curses getting the maximum y value of a window"
}
getbegy_body()
{
	h_run getbegy
}

atf_test_case getbegx
getbegx_head()
{
	atf_set "descr" "Validate curses getting the maximum y value of a window"
}
getbegx_body()
{
	h_run getbegx
}

atf_test_case mvcur
mvcur_head()
{
	atf_set "descr" "Move the cursor on the screen"
}
mvcur_body()
{
	h_run mvcur
}


##########################################
# curses window routines
##########################################

atf_test_case copywin
copywin_head()
{
	atf_set "descr" "Check all the modes of copying a window work"
}
copywin_body()
{
	h_run copywin
}

atf_test_case dupwin
dupwin_head()
{
	atf_set "descr" "Check duplicating a window works"
}
dupwin_body()
{
	h_run dupwin
}

atf_test_case delwin
delwin_head()
{
    atf_set "descr" "Tests deleting a window"
}
delwin_body()
{
    h_run delwin
}

atf_test_case derwin
derwin_head()
{
	atf_set "descr" "Check derived subwindow creation behaves correctly."
}
derwin_body()
{
	h_run derwin
}

atf_test_case mvwin
mvwin_head()
{
	atf_set "descr" "Check moving a window"
}
mvwin_body()
{
	h_run mvwin
}

atf_test_case mvderwin
mvderwin_head()
{
	atf_set "descr" "Move the mapping of a region relative to the parent"
}
mvderwin_body()
{
	h_run mvderwin
}

atf_test_case newwin
newwin_head()
{
    atf_set "descr" "Check creating a new window"
}
newwin_body()
{
    h_run newwin
}

atf_test_case overlay
overlay_head()
{
    atf_set "descr" "Checks overlaying the overlapping portion of two windows"
}
overlay_body()
{
    h_run overlay
}

atf_test_case overwrite
overwrite_head()
{
    atf_set "descr" "Checks overwriting the overlapping portion of two windows"
}
overwrite_body()
{
    h_run overwrite
}

atf_test_case getwin
getwin_head()
{
    atf_set "descr" "Tests dumping window to, and reloading window from, a file"
}
getwin_body()
{
    h_run getwin
}

##########################################
# curses background attribute manipulation routines
##########################################

atf_test_case background
background_head()
{
	atf_set "descr" "Check setting background character and attributes for both stdscr and a window."
}
background_body()
{
	h_run background
}

atf_test_case bkgdset
bkgdset_head()
{
	atf_set "descr" "Validate curses set the background attributes on stdscr"
}
bkgdset_body()
{
	h_run bkgdset
}

atf_test_case bkgrndset
bkgrndset_head()
{
	atf_set "descr" "Validate curses sets the background character using a complex char on stdscr"
}
bkgrndset_body()
{
	h_run bkgrndset
}

atf_test_case getbkgd
getbkgd_head()
{
	atf_set "descr" "Validate curses getting the background attributes on stdscr"
}
getbkgd_body()
{
	h_run getbkgd
}

##########################################
# curses border drawing routines
##########################################

atf_test_case box
box_head()
{
	atf_set "descr" "Checks drawing a box around a window"
}
box_body()
{
	h_run box
}

atf_test_case box_set
box_set_head()
{
    atf_set "descr" "Checks drawing the box from complex character"
}
box_set_body()
{
    h_run box_set
}

atf_test_case wborder
wborder_head()
{
	atf_set "descr" "Checks drawing a border around a window"
}
wborder_body()
{
	h_run wborder
}

atf_test_case border_set
border_set_head()
{
    atf_set "descr" "Checks drawing borders from complex characters and renditions on stdscr"
}
border_set_body()
{
    h_run border_set
}

atf_test_case wborder_set
wborder_set_head()
{
    atf_set "descr" "Checks drawing borders from complex characters and renditions on window"
}
wborder_set_body()
{
    h_run wborder_set
}

##########################################
# curses insert or delete lines routines
##########################################

atf_test_case deleteln
deleteln_head()
{
    atf_set "descr" "Checks curses can delete lines from stdscr and window both"
}
deleteln_body()
{
    h_run deleteln
}

atf_test_case insertln
insertln_head()
{
    atf_set "descr" "Checks curses can insert lines from stdscr and window both"
}
insertln_body()
{
    h_run insertln
}

atf_test_case insdelln
insdelln_head()
{
    atf_set "descr" "Checks curses can insert/delete lines from stdscr and window both based on argument"
}
insdelln_body()
{
    h_run insdelln
}

##########################################
# curses print formatted strings on windows routines
##########################################

atf_test_case wprintw
wprintw_head()
{
	atf_set "descr" "Checks printing to a window"
}
wprintw_body()
{
	h_run wprintw
}

atf_test_case mvprintw
mvprintw_head()
{
	atf_set "descr" "Move the cursor and print a string"
}
mvprintw_body()
{
	h_run mvprintw
}

atf_test_case mvscanw
mvscanw_head()
{
	atf_set "descr" "Move the cursor and scan for input patterns"
}
mvscanw_body()
{
	h_run mvscanw
}

##########################################
# curses underscore attribute manipulation routines
##########################################

atf_test_case underscore
underscore_head()
{
	atf_set "descr" "Manipulate underscore attribute on stdscr"
}
underscore_body()
{
	h_run underscore
}

atf_test_case wunderscore
wunderscore_head()
{
	atf_set "descr" "Manipulate underscore attribute on window"
}
wunderscore_body()
{
	h_run wunderscore
}

##########################################
# Simulate curses application behaviour
##########################################

atf_test_case mutt_test
mutt_test_head()
{
	atf_set "descr" "Try to emulate a curses application"
}
mutt_test_body()
{
	h_run mutt_test
}

atf_init_test_cases()
{
	# testframe utility functions
	atf_add_test_case startup
	atf_add_test_case window
	atf_add_test_case start_slk
	atf_add_test_case window_hierarchy
	atf_add_test_case two_window
	atf_add_test_case varcheck

	# curses add characters to window routines
	atf_add_test_case addbytes
	atf_add_test_case addch
	atf_add_test_case waddch
	atf_add_test_case mvaddch
	atf_add_test_case addchstr
	atf_add_test_case waddchstr
	atf_add_test_case addchnstr
	atf_add_test_case waddchnstr
	atf_add_test_case mvaddchstr
	atf_add_test_case mvwaddchstr
	atf_add_test_case mvaddchnstr
	atf_add_test_case mvwaddchnstr
	atf_add_test_case addstr
	atf_add_test_case addwstr
	atf_add_test_case waddstr
	atf_add_test_case waddwstr
	atf_add_test_case addnstr
	atf_add_test_case addnwstr
	atf_add_test_case waddnstr
	atf_add_test_case waddnwstr
	atf_add_test_case mvwaddnwstr
	atf_add_test_case mvaddstr
	atf_add_test_case mvaddwstr
	atf_add_test_case mvwaddwstr
	atf_add_test_case mvwaddstr
	atf_add_test_case mvaddnstr
	atf_add_test_case mvaddnwstr
	atf_add_test_case mvwaddnstr
	atf_add_test_case add_wch
	atf_add_test_case wadd_wch

	# curses input stream routines
	atf_add_test_case getch
	#atf_add_test_case wgetch [test is missing]
	atf_add_test_case define_key
	atf_add_test_case keyok
	atf_add_test_case getnstr
	atf_add_test_case wgetnstr
	atf_add_test_case mvgetnstr
	atf_add_test_case mvwgetnstr
	atf_add_test_case getstr
	atf_add_test_case wgetstr
	atf_add_test_case mvgetstr
	atf_add_test_case mvwgetstr
	atf_add_test_case keyname
	atf_add_test_case key_name
	atf_add_test_case keypad
	atf_add_test_case notimeout
	atf_add_test_case timeout
	atf_add_test_case wtimeout
	atf_add_test_case nodelay
	atf_add_test_case unget_wch
	atf_add_test_case getn_wstr
	atf_add_test_case wgetn_wstr
	atf_add_test_case get_wstr
	atf_add_test_case wget_wstr
	atf_add_test_case mvgetn_wstr
	atf_add_test_case mvwgetn_wstr
	atf_add_test_case mvget_wstr
	atf_add_test_case mvwget_wstr
	atf_add_test_case get_wch

	# curses read screen contents routines
	atf_add_test_case inch
	atf_add_test_case winch
	atf_add_test_case mvinch
	atf_add_test_case mvwinch
	atf_add_test_case inchnstr
	atf_add_test_case winchnstr
	atf_add_test_case mvinchnstr
	atf_add_test_case mvwinchnstr
	atf_add_test_case innstr
	atf_add_test_case winnstr
	atf_add_test_case mvinnstr
	atf_add_test_case mvwinnstr
	atf_add_test_case in_wch
	atf_add_test_case win_wch
	atf_add_test_case innwstr
	atf_add_test_case winnwstr
	atf_add_test_case inwstr
	atf_add_test_case winwstr
	atf_add_test_case mvinnwstr
	atf_add_test_case mvwinnwstr
	atf_add_test_case mvinwstr
	atf_add_test_case mvwinwstr

	# curses insert character to window routines
	atf_add_test_case insch
	atf_add_test_case winsch
	atf_add_test_case mvinsch
	atf_add_test_case mvwinsch
	atf_add_test_case ins_wch
	atf_add_test_case wins_wch
	atf_add_test_case mvins_wch
	atf_add_test_case mvwins_wch
	atf_add_test_case ins_nwstr
	atf_add_test_case wins_nwstr
	atf_add_test_case ins_wstr
	atf_add_test_case wins_wstr
	atf_add_test_case mvins_nwstr
	atf_add_test_case mvwins_nwstr
	atf_add_test_case mvins_wstr
	atf_add_test_case mvwins_wstr

	# curses delete characters routines
	atf_add_test_case delch
	atf_add_test_case mvdelch

	# curses terminal manipulation routines
	atf_add_test_case beep
	atf_add_test_case flash
	atf_add_test_case curs_set
	# atf_add_test_case delay_output [WORKS CORRECTLY BUT FAILS IN TESTFRAME]
	atf_add_test_case erasechar
	atf_add_test_case erasewchar
	atf_add_test_case echochar
	atf_add_test_case echo_wchar
	atf_add_test_case wecho_wchar
	atf_add_test_case halfdelay
	atf_add_test_case has_ic
	atf_add_test_case killchar
	atf_add_test_case killwchar
	atf_add_test_case meta
	atf_add_test_case cbreak
	atf_add_test_case nocbreak

	# curses general attribute manipulation routines
	atf_add_test_case attributes
	atf_add_test_case wattributes
	atf_add_test_case getattrs
	atf_add_test_case color_set
	atf_add_test_case wcolor_set
	atf_add_test_case termattrs

	# curses on-screen attribute manipulation routines
	atf_add_test_case chgat
	atf_add_test_case wchgat
	atf_add_test_case mvchgat
	atf_add_test_case mvwchgat

	# curses standout attribute manipulation routines
	atf_add_test_case standout
	atf_add_test_case wstandout

	# curses color manipulation routines
	atf_add_test_case has_colors
	atf_add_test_case can_change_color
	atf_add_test_case start_color
	atf_add_test_case pair_content
	atf_add_test_case init_color
	atf_add_test_case color_content
	atf_add_test_case assume_default_colors

	# curses clear window routines
	atf_add_test_case clear
	atf_add_test_case clearok

	# curses terminal update routines
	atf_add_test_case doupdate
	atf_add_test_case immedok
	atf_add_test_case leaveok

	# curses window scrolling routines
	atf_add_test_case wscrl
	atf_add_test_case scroll
	atf_add_test_case setscrreg
	atf_add_test_case wsetscrreg

	# curses window modification routines
	atf_add_test_case touchline
	atf_add_test_case touchoverlap
	atf_add_test_case touchwin
	atf_add_test_case untouchwin
	atf_add_test_case wtouchln
	atf_add_test_case is_linetouched
	atf_add_test_case is_wintouched
	atf_add_test_case redrawwin
	atf_add_test_case wresize
	atf_add_test_case wredrawln

	# curses soft label key routines
	atf_add_test_case slk

	# curses draw lines on windows routines
	atf_add_test_case hline
	atf_add_test_case whline
	atf_add_test_case mvhline
	atf_add_test_case wvline
	atf_add_test_case mvvline
	atf_add_test_case hline_set
	atf_add_test_case whline_set
	atf_add_test_case vline_set
	atf_add_test_case wvline_set

	# curses pad routines
	atf_add_test_case pad
	atf_add_test_case pechochar

	# curses cursor and window location and positioning routines
	atf_add_test_case cursor
	atf_add_test_case getcurx
	atf_add_test_case getmaxx
	atf_add_test_case getmaxy
	atf_add_test_case getparx
	atf_add_test_case getbegy
	atf_add_test_case getbegx
	atf_add_test_case mvcur

	# curses window routines
	atf_add_test_case copywin
	atf_add_test_case dupwin
	# atf_add_test_case delwin [FAILING]
	atf_add_test_case derwin
	atf_add_test_case mvwin
	atf_add_test_case mvderwin
	atf_add_test_case newwin
	atf_add_test_case overlay
	atf_add_test_case overwrite
	atf_add_test_case getwin

	# curses background attribute manipulation routines
	atf_add_test_case background
	atf_add_test_case bkgdset
	atf_add_test_case bkgrndset
	atf_add_test_case getbkgd

	# curses border drawing routines
	atf_add_test_case box
	atf_add_test_case box_set
	atf_add_test_case wborder
	atf_add_test_case border_set
	atf_add_test_case wborder_set

	# curses insert or delete lines routines
	atf_add_test_case deleteln
	atf_add_test_case insertln
	atf_add_test_case insdelln

	# curses print formatted strings on windows routines
	atf_add_test_case wprintw
	atf_add_test_case mvprintw
	atf_add_test_case mvscanw

	# curses underscore attribute manipulation routines
	atf_add_test_case underscore
	atf_add_test_case wunderscore

	# emulate a curses application
	atf_add_test_case mutt_test
}