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: Ciconic.c /main/3 1995/10/31 11:48:03 rswiston $ */
30 #define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
36 void TestIconify(WinName, String, TestNum)
37 char *WinName, *String;
40 char Str[IMAGE_FILE_LEN];
41 sprintf(Str, "%siconic%d", IMAGE_DIR, TestNum);
42 MatchWindows(WinName, Str);
44 if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
45 PrintTermString(WinName, String);
46 sprintf(Str, "%siconic%dA", IMAGE_DIR, TestNum);
47 MatchWindows(WinName, Str);
51 void TestIconifyMap(WinName, String, TestNum)
52 char *WinName, *String;
55 char Str[IMAGE_FILE_LEN];
56 sprintf(Str, "%siconic%d", IMAGE_DIR, TestNum);
57 MatchWindows(WinName, Str);
59 if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
60 PrintTermString(WinName, String);
61 sprintf(Str, "%siconic%dA", IMAGE_DIR, TestNum);
62 MatchWindows(WinName, Str);
63 PrintTermString(WinName, "1");
67 if (WaitWinMap(WinName) == 0) LogError("+map did not work");
70 if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
76 static char *OptionArr[] = {
78 /*1*/ " -iconic -xrm 'dtterm*iconName: test' ",
79 /*2*/ " -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
80 /*3*/ " -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
83 static char *LogAction[] = {
84 "Testing Option -iconic ",
85 "Testing Option -iconic -xrm 'dtterm*iconName: test' ",
86 "Testing Option -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
87 "Testing Option -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
90 #define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
97 char Command[NEED_LEN];
101 if ((TermLog = fopen("term.log", "a")) == NULL) {
102 if ((TermLog = fopen("term.log", "w")) == NULL)
103 {printf("Logfile could not be opened \n"); exit(-1);}
105 LogError("****************************************************************************");
107 sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
110 InitTest(argc, argv);
111 for (i=0; i < ArrCount; i++) {
112 strcpy(Command, TERM_EMU);
113 strcat(Command, OptionArr[i]);
115 LogError(LogAction[i]);
116 ExecCommand(Command);
117 if (WaitWinMap("TermWin") < 0) continue;
118 AssignWinName("TermWin", TERM_EMU);
119 if (i <= 1) TestIconify("TermWin", OptionArr[i], i+1);
120 else TestIconifyMap("TermWin", OptionArr[i], i+1);
121 WaitWinUnMap("TermWin", 60L);
125 sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
127 LogError("****************************************************************************");