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 librararies 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: Rwrap.c /main/3 1995/10/31 11:55:31 rswiston $ */
31 #define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
39 void TestWrap(WinName, String, TestNum)
40 char *WinName, *String;
43 char Str[IMAGE_FILE_LEN];
45 PressKeyNtimes(WinName, "C", 100);
46 for (i=0; i < 75; i++)
47 PressBackSpace(WinName);
48 sprintf(Str, "%srwrap%d", IMAGE_DIR, TestNum);
49 MatchWindows(WinName, Str);
53 static char *ResourceArr[] = {
54 /*0*/ "autoWrap True reverseWrap True ",
55 /*1*/ "autoWrap False reverseWrap False ",
56 /*2*/ "autoWrap True reverseWrap False "
59 static char *LogAction[] = {
60 "Testing Resource Option: autoWrap True reverseWrap True ",
61 "Testing Resource Option:autoWrap False reverseWrap False ",
62 "Testing Resource Option:autoWrap True reverseWrap False "
65 #define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
67 int MakeResourceFile(ResArr)
72 char Resource[50], Value[50];
74 if ((ResFile = fopen("res", "w")) == NULL)
75 {LogError("Resource File Creation fail"); return(-1);}
76 for (i=0; i < 50; i++) Resource[i] = BLANK;
77 for (i=0; i < 50; i++) Value[i] = BLANK;
78 Len = strlen(ResArr); i=0;
81 while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
82 Resource[j] = NULLCHAR;
84 while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
85 Value[j++] = ResArr[i++];
88 fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
98 char Command[NEED_LEN];
102 if ((TermLog = fopen("term.log", "a")) == NULL) {
103 if ((TermLog = fopen("term.log", "w")) == NULL)
104 {printf("Logfile could not be opened \n"); exit(-1);}
106 fprintf(TermLog, "**************************************************\n");
108 fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
110 InitTest(argc, argv);
111 for (i=0; i < ArrCount; i++) {
113 ExecCommand("xrdb -load xrdb.out");
114 MakeResourceFile(ResourceArr[i]);
115 LogError(LogAction[i]);
116 strcpy(Command, "xrdb -merge res; ");
117 strcat(Command, TERM_EMU);
119 ExecCommand(Command);
120 if (WaitWinMap("TermWin") < 0) continue;
121 AssignWinName("TermWin", TERM_EMU);
122 TestWrap("TermWin", "Checking Pointer Resources ", i+1);
123 WaitWinUnMap("TermWin", 60L);
126 ExecCommand("xrdb -load xrdb.out");
129 fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);