2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: charatt.c /main/3 1995/10/31 11:55:53 rswiston $ */
30 #define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
41 static char *DispAttArr[] = {"Normal","Bold", "Underscore", "Inverse", "Blink"};
43 static SetDispAttr(WhichAttr, NewLine, BlinkOn)
45 Bool NewLine, BlinkOn;
49 SetDispNormal(); break;
53 SetDispUnderscore(); break;
55 SetDispInverse(); break;
57 if (BlinkOn == True) SetDispBlink();
58 WRITETEST(DispAttArr[WhichAttr]);
59 if (NewLine == True) {
66 void TestDispAtt(WinName)
69 int i, j, k, Lines, Cols;
70 char Str[IMAGE_FILE_LEN];
74 for (i=0; i < 2; i++) {
75 if (i == 1) BlinkOn = True;
77 SetDispAttr(Normal, True, BlinkOn);
78 SetDispAttr(Bold, True, BlinkOn);
79 SetDispAttr(Underscore, True, BlinkOn);
80 SetDispAttr(Inverse, True, BlinkOn);
81 SetDispAttr(Bold, False, BlinkOn);
82 SetDispAttr(Underscore, True, BlinkOn);
83 SetDispAttr(Bold, False, BlinkOn);
84 SetDispAttr(Inverse, True, BlinkOn);
85 SetDispAttr(Bold, False, BlinkOn);
86 SetDispAttr(Underscore, False, BlinkOn);
87 SetDispAttr(Inverse, True, BlinkOn);
88 SetDispAttr(Underscore, False, BlinkOn);
89 SetDispAttr(Inverse, True, BlinkOn);
92 sprintf(Str, "%scharatt1", IMAGE_DIR);
93 MatchWindows(WinName, Str);
99 void TestCursor(WinName)
102 char Str[IMAGE_FILE_LEN];
103 SetScrollRegn(5, 15);
107 SetOriginMode(DECModeSet); /* To Origin Mode */
108 SetWrapMode(DECModeSet);
109 AbsoluteGoToXY(46, 14);
112 SetOriginMode(DECModeReset);
113 SetWrapMode(DECModeReset);
115 WRITETEST("Now In Normal Char Att; Cursor Mode; in Line 1; with no wrap and on restoring cursor");
117 WRITETEST("You did not see full line because of no wrap;On Restoring Cursor");
119 WRITETEST("I Should start at (46,14) with char attribute Bold Inverse Underline, Origin mode set, scrolling region is 5,15 with wrap mode on");
121 sprintf(Str, "%scharatt2", IMAGE_DIR);
122 MatchWindows(WinName, Str);
130 SetOriginMode(DECModeReset);
131 SetScrollRegn(1, Cols);
139 int NumLines, NumCols;
141 if ((TermLog = fopen("term.log", "a")) == NULL) {
142 if ((TermLog = fopen("term.log", "w")) == NULL)
143 {printf("Logfile could not be opened \n"); exit(-1);}
145 fprintf(TermLog, "**************************************************\n");
147 fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
150 if (CheckTermStatus() == -1)
151 {printf("terminal emulator malfunctioning\n"); DONE(); return;}
152 GetWinSize(&NumLines, &NumCols);
154 InitTest(argc, argv);
155 AssignWinName("TermWin", TERM_EMU);
157 TestDispAtt("TermWin");
161 TestCursor("TermWin");
168 fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);