Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
85
cde/programs/dtterm/tests/Cborder/Cborder.c
Normal file
85
cde/programs/dtterm/tests/Cborder/Cborder.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/* $XConsortium: Cborder.c /main/3 1995/10/31 11:47:04 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestBorder(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sborder%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -bd red -bw 10",
|
||||
/*1*/ " -bd green -bw 6",
|
||||
/*2*/ " -bd blue -bw 12",
|
||||
/*3*/ " -bd yellow -bw 15",
|
||||
/*4*/ " -bordercolor cyan -borderwidth 7",
|
||||
/*5*/ " -bordercolor brown -borderwidth 8",
|
||||
/*6*/ " -w 10"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing option -bd red -bw 10",
|
||||
/*1*/ "Testing option -bd green -bw 6",
|
||||
/*2*/ "Testing option -bd blue -bw 12",
|
||||
/*3*/ "Testing option -bd yellow -bw 15",
|
||||
/*4*/ "Testing option -bordercolor cyan -borderwidth 7",
|
||||
/*5*/ "Testing option -bordercolor brown -borderwidth 8",
|
||||
/*6*/ "Testing option -w 10"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestBorder("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Cborder/Imakefile
Normal file
51
cde/programs/dtterm/tests/Cborder/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:06:46 drk $
|
||||
PROGRAMS = Cborder
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cborder.c
|
||||
|
||||
OBJS = Cborder.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
cde/programs/dtterm/tests/Cborder/README
Normal file
26
cde/programs/dtterm/tests/Cborder/README
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:16:05 drk $ */
|
||||
TestName: Cborder
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
" -bd red -bw 10",
|
||||
" -bd green -bw 6",
|
||||
" -bd blue -bw 12",
|
||||
" -bd yellow -bw 15",
|
||||
" -bordercolor cyan -borderwidth 7",
|
||||
" -bordercolor brown -borderwidth 8",
|
||||
" -w 10"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
94
cde/programs/dtterm/tests/Cgeomcolor/Cgeomcolor.c
Normal file
94
cde/programs/dtterm/tests/Cgeomcolor/Cgeomcolor.c
Normal file
@@ -0,0 +1,94 @@
|
||||
/* $XConsortium: Cgeomcolor.c /main/3 1995/10/31 11:47:36 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestGeomFgBg(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sgeomcolor%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -geometry 40x20 -fg green -bg red ",
|
||||
/*1*/ " -geometry 60x15 -fg red -bg green ",
|
||||
/*2*/ " -geometry 80x10 -fg green -bg yellow ",
|
||||
/*3*/ " -geometry 80x40 -foreground blue -background cyan ",
|
||||
/*4*/ " -geometry 20x40 -foreground white -background black ",
|
||||
/*5*/ " -rv",
|
||||
/*6*/ " -reverse",
|
||||
/*7*/ " +rv",
|
||||
/*8*/ " -bs ",
|
||||
/*9*/ " +bs ",
|
||||
/*10*/ " -ms red -cr blue",
|
||||
/*11*/ " -ms blue -cr green"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -geometry 40x20 -fg green -bg red ",
|
||||
/*1*/ "Testing Option -geometry 60x15 -fg red -bg green ",
|
||||
/*2*/ "Testing Option -geometry 80x10 -fg green -bg yellow ",
|
||||
/*3*/ "Testing Option -geometry 80x40 -foreground blue -background cyan ",
|
||||
/*4*/ "Testing Option -geometry 20x40 -foreground white -background black ",
|
||||
/*5*/ "Testing Option -rv",
|
||||
/*6*/ "Testing Option -reverse",
|
||||
/*7*/ "Testing Option +rv",
|
||||
/*8*/ "Testing Option -bs ",
|
||||
/*9*/ "Testing Option +bs ",
|
||||
/*10*/ "Testing Option -ms red -cr blue",
|
||||
/*11*/ "Testing Option -ms blue -cr green"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestGeomFgBg("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Cgeomcolor/Imakefile
Normal file
51
cde/programs/dtterm/tests/Cgeomcolor/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:06:54 drk $
|
||||
PROGRAMS = Cgeomcolor
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cgeomcolor.c
|
||||
|
||||
OBJS = Cgeomcolor.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
31
cde/programs/dtterm/tests/Cgeomcolor/README
Normal file
31
cde/programs/dtterm/tests/Cgeomcolor/README
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:16:48 drk $ */
|
||||
TestName: Cgeomcolor
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
" -geometry 40x20 -fg green -bg red ",
|
||||
" -geometry 60x15 -fg red -bg green ",
|
||||
" -geometry 80x10 -fg green -bg yellow ",
|
||||
" -geometry 80x40 -foreground blue -background cyan ",
|
||||
" -geometry 20x40 -foreground white -background black ",
|
||||
" -rv",
|
||||
" -reverse",
|
||||
" +rv",
|
||||
" -bs ",
|
||||
" +bs ",
|
||||
" -ms red -cr blue",
|
||||
" -ms blue -cr green"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
109
cde/programs/dtterm/tests/Ciconic/Ciconic.c
Normal file
109
cde/programs/dtterm/tests/Ciconic/Ciconic.c
Normal file
@@ -0,0 +1,109 @@
|
||||
/* $XConsortium: Ciconic.c /main/3 1995/10/31 11:48:03 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestIconify(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%siconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%siconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
void TestIconifyMap(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%siconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
if (TestNum == 3) {
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%siconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
PrintTermString(WinName, "1");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
else {
|
||||
if (WaitWinMap(WinName) == 0) LogError("+map did not work");
|
||||
else {
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -iconic ",
|
||||
/*1*/ " -iconic -xrm 'dtterm*iconName: test' ",
|
||||
/*2*/ " -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
/*3*/ " -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Option -iconic ",
|
||||
"Testing Option -iconic -xrm 'dtterm*iconName: test' ",
|
||||
"Testing Option -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
"Testing Option -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
if (i <= 1) TestIconify("TermWin", OptionArr[i], i+1);
|
||||
else TestIconifyMap("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Ciconic/Imakefile
Normal file
52
cde/programs/dtterm/tests/Ciconic/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:03 drk $
|
||||
PROGRAMS = Ciconic
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Ciconic.c
|
||||
|
||||
OBJS = Ciconic.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Ciconic/README
Normal file
23
cde/programs/dtterm/tests/Ciconic/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:17:20 drk $ */
|
||||
TestName: Ciconic
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
" -iconic ",
|
||||
" -iconic -xrm 'dtterm*iconName: test' ",
|
||||
" -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
" -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
99
cde/programs/dtterm/tests/Clogging/Clogging.c
Normal file
99
cde/programs/dtterm/tests/Clogging/Clogging.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/* $XConsortium: Clogging.c /main/3 1995/10/31 11:48:35 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -l ", /* Normal option */
|
||||
/*1*/ " -xrm 'dtterm*logging: off' -l ", /* By resource log off*/
|
||||
/*2*/ " -l ", /* try in un writable directory */
|
||||
/*3*/ " -xrm 'dtterm*logging: on' -xrm 'dtterm*logFile: Term.Log ' +l ",
|
||||
/*4*/ " -lf Term.Log"
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing option: -l ",
|
||||
/*1*/ "Testing option -xrm 'dtterm*logging: off' -l ",
|
||||
/*2*/ "Testing option -l in an unwritable directory",
|
||||
/*3*/ "Testing option -xrm 'dtterm*logging: on' -xrm 'dtterm*logFile: Term.Log' +l",
|
||||
/*4*/ "Testing option -lf Term.Log"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mkdir tmplog");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mv DTtermLog* tmplog"); sleep(1);
|
||||
ExecCommand("mv Term.Log tmplog"); sleep(1);
|
||||
if (i == 2) { /* try in un writable directory */
|
||||
ExecCommand("mkdir unwrite"); sleep(1);
|
||||
ExecCommand("chmod 555 unwrite"); sleep(1);
|
||||
ExecCommand("cd unwrite"); sleep(1);
|
||||
}
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command); sleep(1);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
JustExit("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
switch (i) {
|
||||
case 0:
|
||||
ExecCommand("test-l"); break;
|
||||
case 1:
|
||||
ExecCommand("test-l"); break;
|
||||
case 2:
|
||||
ExecCommand("test+l"); break;
|
||||
case 3: ExecCommand("test+l"); break;
|
||||
case 4: ExecCommand("test-lf"); break;
|
||||
}
|
||||
if (i == 2) {
|
||||
ExecCommand("cd ..");
|
||||
ExecCommand("rmdir unwrite");
|
||||
}
|
||||
sleep(2);
|
||||
}
|
||||
ExecCommand("mv tmplog/DTtermLog* ."); sleep(1);
|
||||
ExecCommand("mv tmplog/Term.Log ."); sleep(1);
|
||||
ExecCommand("rmdir tmplog");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Clogging/Imakefile
Normal file
51
cde/programs/dtterm/tests/Clogging/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:11 drk $
|
||||
PROGRAMS = Clogging
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Clogging.c
|
||||
|
||||
OBJS = Clogging.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Clogging/README
Normal file
24
cde/programs/dtterm/tests/Clogging/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:17:58 drk $ */
|
||||
TestName: Clogging
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
"Testing option: -l ",
|
||||
"Testing option -xrm 'dtterm*logging: off' -l ",
|
||||
"Testing option -l in an unwritable directory",
|
||||
"Testing option -xrm 'dtterm*logging: on'
|
||||
-xrm 'dtterm*logFile: Term.Log' +l",
|
||||
"Testing option -lf Term.Log"
|
||||
|
||||
and invokes one of the programs (test-l, test+l, test-lf)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
82
cde/programs/dtterm/tests/Clogin/Clogin.c
Normal file
82
cde/programs/dtterm/tests/Clogin/Clogin.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/* $XConsortium: Clogin.c /main/3 1995/10/31 11:48:57 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -ls " , /* Normal option */
|
||||
/*1*/ " -xrm 'dtterm*loginShell: off' -ls ",
|
||||
/*2*/ " -xrm 'dtterm*loginShell: on' +ls ",
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -ls ",
|
||||
/*1*/ "Testing Option -xrm 'dtterm*loginShell: off' -ls ",
|
||||
/*2*/ "Testing Option -xrm 'dtterm*loginShell: on' +ls "
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
Path = getenv("PATH");
|
||||
ExecCommand("PATH=/clone/vels/cdetest/bin:/usr/bin/X11:/bin:/opt/dt/bin");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
switch (i) {
|
||||
case 0:
|
||||
ExecCommand("test-ls"); break;
|
||||
case 1:
|
||||
ExecCommand("test-ls"); break;
|
||||
case 2:
|
||||
ExecCommand("test+ls"); break;
|
||||
}
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
strcpy(Command, "PATH=");
|
||||
strcat(Command, Path);
|
||||
ExecCommand(Command);
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Clogin/Imakefile
Normal file
51
cde/programs/dtterm/tests/Clogin/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:19 drk $
|
||||
PROGRAMS = Clogin
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Clogin.c
|
||||
|
||||
OBJS = Clogin.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
cde/programs/dtterm/tests/Clogin/README
Normal file
21
cde/programs/dtterm/tests/Clogin/README
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:18:33 drk $ */
|
||||
TestName: Clogin
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -ls " ,
|
||||
" -xrm 'dtterm*loginShell: off' -ls ",
|
||||
" -xrm 'dtterm*loginShell: on' +ls ",
|
||||
|
||||
and invokes one of the programs (test-ls, test+ls)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
88
cde/programs/dtterm/tests/Csavelines/Csavelines.c
Normal file
88
cde/programs/dtterm/tests/Csavelines/Csavelines.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/* $XConsortium: Csavelines.c /main/3 1995/10/31 11:49:19 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestSavelines(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
ExecWinCommand(WinName, "printlines");
|
||||
sleep(2);
|
||||
for (i=0; i < 4; i++) PressPrevKey(WinName);
|
||||
sleep(2);
|
||||
sprintf(Str, "%ssavelines%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
sleep(2);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*1*/ " -sl 24l",
|
||||
/*2*/ " -sl 48l",
|
||||
/*3*/ " -sl 96l",
|
||||
/*4*/ " -sl 1s",
|
||||
/*5*/ " -sl 2s",
|
||||
/*6*/ " -sl 4s"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*1*/ "Testing Option -sl 24l",
|
||||
/*2*/ "Testing Option -sl 48l",
|
||||
/*3*/ "Testing Option -sl 96l",
|
||||
/*4*/ "Testing Option -sl 1s",
|
||||
/*5*/ "Testing Option -sl 2s",
|
||||
/*6*/ "Testing Option -sl 4s"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestSavelines("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Csavelines/Imakefile
Normal file
52
cde/programs/dtterm/tests/Csavelines/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:34 drk $
|
||||
PROGRAMS = Csavelines
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Csavelines.c
|
||||
|
||||
OBJS = Csavelines.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
cde/programs/dtterm/tests/Csavelines/README
Normal file
26
cde/programs/dtterm/tests/Csavelines/README
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:18:51 drk $ */
|
||||
TestName: Csavelines
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -sl 24l",
|
||||
" -sl 48l",
|
||||
" -sl 96l",
|
||||
" -sl 1s",
|
||||
" -sl 2s",
|
||||
" -sl 4s"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
79
cde/programs/dtterm/tests/Cscrolltitle/Cscrolltitle.c
Normal file
79
cde/programs/dtterm/tests/Cscrolltitle/Cscrolltitle.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* $XConsortium: Cscrolltitle.c /main/3 1995/10/31 11:49:44 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestScrollbar(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sscrollbar%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -sb -title TITLE1",
|
||||
/*1*/ " +sb -title title2",
|
||||
/*2*/ " -xrm 'dtterm*scrollBar: False' -sb -title TITLE3",
|
||||
/*3*/ " -xrm 'dtterm*scrollBar: True' +sb -title title4"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -sb ",
|
||||
/*1*/ "Testing Option +sb ",
|
||||
/*2*/ "Testing Option -xrm 'dtterm*scrollBar: False' -sb",
|
||||
/*3*/ "Testing Option -xrm 'dtterm*scrollBar: True' +sb"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestScrollbar("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Cscrolltitle/Imakefile
Normal file
52
cde/programs/dtterm/tests/Cscrolltitle/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:43 drk $
|
||||
PROGRAMS = Cscrolltitle
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cscrolltitle.c
|
||||
|
||||
OBJS = Cscrolltitle.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
25
cde/programs/dtterm/tests/Cscrolltitle/README
Normal file
25
cde/programs/dtterm/tests/Cscrolltitle/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:19:09 drk $ */
|
||||
TestName: Cscrolltitle
|
||||
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -sb -title TITLE1",
|
||||
" +sb -title title2",
|
||||
" -xrm 'dtterm*scrollBar: False' -sb -title TITLE3",
|
||||
" -xrm 'dtterm*scrollBar: True' +sb -title title4"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
65
cde/programs/dtterm/tests/Ctm/Ctm.c
Normal file
65
cde/programs/dtterm/tests/Ctm/Ctm.c
Normal file
@@ -0,0 +1,65 @@
|
||||
/* $XConsortium: Ctm.c /main/3 1995/10/31 11:50:16 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -tm 'intr ! quit @ erase # kill $ eof % eol ^ swtch & start * stop ( susp ) dsusp _'" /* Normal option */
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -tm "
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
ExecCommand("termget");
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Ctm/Imakefile
Normal file
52
cde/programs/dtterm/tests/Ctm/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:51 drk $
|
||||
PROGRAMS = Ctm
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Ctm.c
|
||||
|
||||
OBJS = Ctm.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Ctm/README
Normal file
23
cde/programs/dtterm/tests/Ctm/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:19:28 drk $ */
|
||||
TestName: Ctm
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -tm 'intr ! quit @ erase # kill $ eof % eol ^ swtch &
|
||||
start * stop ( susp ) dsusp _'"
|
||||
|
||||
it runs a program 'termget' (in util directory) to verify
|
||||
whether above things are set and reportes whatever is not
|
||||
set.
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
84
cde/programs/dtterm/tests/Cvisualbell/Cvisualbell.c
Normal file
84
cde/programs/dtterm/tests/Cvisualbell/Cvisualbell.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/* $XConsortium: Cvisualbell.c /main/3 1995/10/31 11:50:50 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestVisualbell(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
for (i=0; i < 4; i++)
|
||||
PressCtrlGKey(WinName);
|
||||
if (TestNum > 2)
|
||||
PrintTermString(WinName, "You should have heard beep");
|
||||
else
|
||||
PrintTermString(WinName, "You should have seen screen flashing");
|
||||
sleep(5);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -vb ",
|
||||
/*1*/ " -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " +vb ",
|
||||
/*3*/ " -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ " Testing Option: -vb ",
|
||||
/*1*/ " Testing Option: -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " Testing Option: +vb ",
|
||||
/*3*/ " Testing Option: -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestVisualbell("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Cvisualbell/Imakefile
Normal file
52
cde/programs/dtterm/tests/Cvisualbell/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:58 drk $
|
||||
PROGRAMS = Cvisualbell
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cvisualbell.c
|
||||
|
||||
OBJS = Cvisualbell.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Cvisualbell/README
Normal file
23
cde/programs/dtterm/tests/Cvisualbell/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:19:50 drk $ */
|
||||
TestName: Cvisualbell
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -vb ",
|
||||
" -xrm 'visualBell: False' -vb",
|
||||
" +vb ",
|
||||
" -xrm 'visualBell: True' +vb"
|
||||
|
||||
this ia mannual verification test
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
15
cde/programs/dtterm/tests/Imakefile
Normal file
15
cde/programs/dtterm/tests/Imakefile
Normal file
@@ -0,0 +1,15 @@
|
||||
XCOMM $XConsortium: Imakefile /main/3 1995/10/31 11:46:52 rswiston $
|
||||
#define IHaveSubdirs
|
||||
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
|
||||
|
||||
|
||||
/*SUBDIRS = access format helpApiTest quickApiTest terminal*/
|
||||
SUBDIRS = shared Cborder Cgeomcolor Ciconic Clogging Clogin Csavelines \
|
||||
Cscrolltitle \
|
||||
Ctm Cvisualbell Rborder Rgeomcolor Riconic Rlogging \
|
||||
Rlogin Rpointer Rsavelines Rscrolltitle Rtm Rvisualbell Rwrap \
|
||||
charatt curmove decmode edittest erase keypad scroll sgr \
|
||||
tabctrl util
|
||||
|
||||
MakeSubdirs($(SUBDIRS))
|
||||
DependSubdirs($(SUBDIRS))
|
||||
25
cde/programs/dtterm/tests/README
Normal file
25
cde/programs/dtterm/tests/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:20:15 drk $ */
|
||||
this test directory contains subdirectories (one for each test)
|
||||
|
||||
directory which starts with R - contains program to test some of the
|
||||
resources
|
||||
|
||||
directory which starts with C - contains program to test some of the
|
||||
command line option
|
||||
|
||||
directory which does not start with C or R -
|
||||
contains program to test some of the
|
||||
escape sequences
|
||||
|
||||
You will find README in each subdirectory which gives information
|
||||
about the test and if it refers to dtterm.object, you can find the
|
||||
file in data subdirectory.
|
||||
|
||||
all resource tests (starts with R) expect a file named xrdb.out in
|
||||
the directory in which you tests. you can create that file by
|
||||
executing the command xrdb -q > xrdb.out (it's basically the current
|
||||
resource setup)
|
||||
|
||||
let me know if in case you need. my email add vels@hpcvlx.cv.hp.com
|
||||
|
||||
|
||||
52
cde/programs/dtterm/tests/Rborder/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rborder/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:06 drk $
|
||||
PROGRAMS = Rborder
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rborder.c
|
||||
|
||||
OBJS = Rborder.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
27
cde/programs/dtterm/tests/Rborder/README
Normal file
27
cde/programs/dtterm/tests/Rborder/README
Normal file
@@ -0,0 +1,27 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:20:52 drk $ */
|
||||
TestName: Rborder
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set.
|
||||
|
||||
"borderColor red borderWidth 10 ",
|
||||
"borderColor green borderWidth 6 ",
|
||||
"borderColor blue borderWidth 12 ",
|
||||
"borderColor yellow borderWidth 15 ",
|
||||
"borderColor cyan borderWidth 7 ",
|
||||
"borderColor brown borderWidth 8 ",
|
||||
"borderWidth 10 ",
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
128
cde/programs/dtterm/tests/Rborder/Rborder.c
Normal file
128
cde/programs/dtterm/tests/Rborder/Rborder.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/* $XConsortium: Rborder.c /main/3 1995/10/31 11:51:22 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestBorder(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%srborder%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -bd red -bw 10",
|
||||
/*1*/ " -bd green -bw 6",
|
||||
/*2*/ " -bd blue -bw 12",
|
||||
/*3*/ " -bd yellow -bw 15",
|
||||
/*4*/ " -bordercolor cyan -borderwidth 7",
|
||||
/*5*/ " -bordercolor brown -borderwidth 8",
|
||||
/*6*/ " -w 10"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "borderColor red borderWidth 10 ",
|
||||
/*1*/ "borderColor green borderWidth 6 ",
|
||||
/*2*/ "borderColor blue borderWidth 12 ",
|
||||
/*3*/ "borderColor yellow borderWidth 15 ",
|
||||
/*4*/ "borderColor cyan borderWidth 7 ",
|
||||
/*5*/ "borderColor brown borderWidth 8 ",
|
||||
/*6*/ "borderWidth 10 ",
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resourse Option:borderColor red borderWidth 10 ",
|
||||
/*1*/ "Testing Resourse Option:borderColor green borderWidth 6 ",
|
||||
/*2*/ "Testing Resourse Option:borderColor blue borderWidth 12 ",
|
||||
/*3*/ "Testing Resourse Option:borderColor yellow borderWidth 15 ",
|
||||
/*4*/ "Testing Resourse Option:borderColor cyan borderWidth 7 ",
|
||||
/*5*/ "Testing Resourse Option:borderColor brown borderWidth 8 ",
|
||||
/*6*/ "Testing Resourse Option:borderWidth 10 ",
|
||||
};
|
||||
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestBorder("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rgeomcolor/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rgeomcolor/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:14 drk $
|
||||
PROGRAMS = Rgeomcolor
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rgeomcolor.c
|
||||
|
||||
OBJS = Rgeomcolor.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
cde/programs/dtterm/tests/Rgeomcolor/README
Normal file
32
cde/programs/dtterm/tests/Rgeomcolor/README
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:21:26 drk $ */
|
||||
TestName: Rgeomcolor
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"geometry 40x20 foreground green background red",
|
||||
"geometry 60x15 foreground red background green",
|
||||
"geometry 80x10 foreground green background yellow",
|
||||
"geometry 80x40 foreground blue background cyan",
|
||||
"geometry 20x40 foreground white background black",
|
||||
"reverseVideo True",
|
||||
"reverseVideo On",
|
||||
"reverseVideo False",
|
||||
"backgroundIsSelect True",
|
||||
"backgroundIsSelect False",
|
||||
"pointerColor red",
|
||||
"pointerColor blue"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
140
cde/programs/dtterm/tests/Rgeomcolor/Rgeomcolor.c
Normal file
140
cde/programs/dtterm/tests/Rgeomcolor/Rgeomcolor.c
Normal file
@@ -0,0 +1,140 @@
|
||||
/* $XConsortium: Rgeomcolor.c /main/3 1995/10/31 11:51:45 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
void TestGeomFgBg(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%srgeomcolor%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -geometry 40x20 -fg green -bg red ",
|
||||
/*1*/ " -geometry 60x15 -fg red -bg green ",
|
||||
/*2*/ " -geometry 80x10 -fg green -bg yellow ",
|
||||
/*3*/ " -geometry 80x40 -foreground blue -background cyan ",
|
||||
/*4*/ " -geometry 20x40 -foreground white -background black ",
|
||||
/*5*/ " -rv",
|
||||
/*6*/ " -reverse",
|
||||
/*7*/ " +rv",
|
||||
/*8*/ " -bs ",
|
||||
/*9*/ " +bs ",
|
||||
/*10*/ " -ms red ",
|
||||
/*11*/ " -ms blue "
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "geometry 40x20 foreground green background red",
|
||||
/*1*/ "geometry 60x15 foreground red background green",
|
||||
/*2*/ "geometry 80x10 foreground green background yellow",
|
||||
/*3*/ "geometry 80x40 foreground blue background cyan",
|
||||
/*4*/ "geometry 20x40 foreground white background black",
|
||||
/*5*/ "reverseVideo True",
|
||||
/*6*/ "reverseVideo On",
|
||||
/*7*/ "reverseVideo False",
|
||||
/*8*/ "backgroundIsSelect True",
|
||||
/*9*/ "backgroundIsSelect False",
|
||||
/*10*/ "pointerColor red",
|
||||
/*11*/ "pointerColor blue"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Resource Option: geometry 40x20 foreground green background red",
|
||||
"Testing Resource Option: geometry 60x15 foreground red background green",
|
||||
"Testing Resource Option: geometry 80x10 foreground green background yellow",
|
||||
"Testing Resource Option: geometry 80x40 foreground blue background cyan",
|
||||
"Testing Resource Option: geometry 20x40 foreground white background black",
|
||||
"Testing Resource Option: reverseVideo True",
|
||||
"Testing Resource Option: reverseVideo On",
|
||||
"Testing Resource Option: reverseVideo False",
|
||||
"Testing Resource Option: backgroundIsSelect True",
|
||||
"Testing Resource Option: backgroundIsSelect False",
|
||||
"Testing Resource Option: pointerColor red",
|
||||
"Testing Resource Option: pointerColor blue"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestGeomFgBg("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Riconic/Imakefile
Normal file
51
cde/programs/dtterm/tests/Riconic/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:23 drk $
|
||||
PROGRAMS = Riconic
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Riconic.c
|
||||
|
||||
OBJS = Riconic.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Riconic/README
Normal file
24
cde/programs/dtterm/tests/Riconic/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:21:45 drk $ */
|
||||
TestName: Riconic
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resources options set
|
||||
|
||||
"iconic True",
|
||||
"iconic True iconName test",
|
||||
"iconic True mapOnOutput True mapOnOutputDelay 5",
|
||||
"iconic True mapOnOutput False mapOnOutputDelay 5"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
151
cde/programs/dtterm/tests/Riconic/Riconic.c
Normal file
151
cde/programs/dtterm/tests/Riconic/Riconic.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/* $XConsortium: Riconic.c /main/3 1995/10/31 11:52:08 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestIconify(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%sriconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sriconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
void TestIconifyMap(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%sriconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
if (TestNum == 3) {
|
||||
if (WaitWinMap(WinName) < 0) LogError("mapOnOutput: True did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sriconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
PrintTermString(WinName, "1");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
else {
|
||||
if (WaitWinMap(WinName) == 0) LogError("mapOnOutput:False did not work");
|
||||
else {
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -iconic ",
|
||||
/*1*/ " -iconic -xrm 'dtterm*iconName: Test' ",
|
||||
/*2*/ " -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
/*3*/ " -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "iconic True",
|
||||
/*1*/ "iconic True iconName test",
|
||||
/*2*/ "iconic True mapOnOutput True mapOnOutputDelay 5",
|
||||
/*3*/ "iconic True mapOnOutput False mapOnOutputDelay 5"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Option iconic True ",
|
||||
"Testing Option iconic True iconName Test",
|
||||
"Testing Option iconic True mapOnOutput True mapOnOutputDelay 5",
|
||||
"Testing Option iconic True mapOnOutput False mapOnOutputDelay 5"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
if (i > 1) strcat(Command, " -e wait5write");
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
if (i <= 1) TestIconify("TermWin", OptionArr[i], i+1);
|
||||
else TestIconifyMap("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rlogging/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rlogging/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:30 drk $
|
||||
PROGRAMS = Rlogging
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rlogging.c
|
||||
|
||||
OBJS = Rlogging.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Rlogging/README
Normal file
23
cde/programs/dtterm/tests/Rlogging/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:22:05 drk $ */
|
||||
TestName: Rlogging
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
|
||||
"logging True",
|
||||
"logging True ",
|
||||
"logging True logFile Term.Log",
|
||||
"logging False logFile Term.Log",
|
||||
|
||||
and invokes either one the scripts (test-l, test+l, test-lf)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
129
cde/programs/dtterm/tests/Rlogging/Rlogging.c
Normal file
129
cde/programs/dtterm/tests/Rlogging/Rlogging.c
Normal file
@@ -0,0 +1,129 @@
|
||||
/* $XConsortium: Rlogging.c /main/3 1995/10/31 11:52:32 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resourse Option:logging True",
|
||||
/*1*/ "Testing Resourse Option:logging True but in unwritable directory",
|
||||
/*2*/ "Testing Resourse Option:logging True logFile Term.Log",
|
||||
/*3*/ "Testing Resourse Option:logging False logFile Term.Log",
|
||||
};
|
||||
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "logging True",
|
||||
/*1*/ "logging True ",
|
||||
/*2*/ "logging True logFile Term.Log",
|
||||
/*3*/ "logging False logFile Term.Log",
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mkdir tmplog");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -merge res"); sleep(5);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mv DTtermLog* tmplog"); sleep(1);
|
||||
ExecCommand("mv Term.Log tmplog"); sleep(1);
|
||||
if (i == 1) { /* try in un writable directory */
|
||||
ExecCommand("mkdir unwrite"); sleep(1);
|
||||
ExecCommand("chmod 555 unwrite"); sleep(1);
|
||||
ExecCommand("cd unwrite"); sleep(1);
|
||||
}
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command); sleep(1);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
JustExit("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
switch (i) {
|
||||
case 0:
|
||||
ExecCommand("test-l"); break;
|
||||
case 1:
|
||||
ExecCommand("test+l"); break;
|
||||
case 2:
|
||||
ExecCommand("test-lf"); break;
|
||||
case 3: ExecCommand("test+l"); break;
|
||||
}
|
||||
if (i == 1) {
|
||||
ExecCommand("cd ..");
|
||||
ExecCommand("rmdir unwrite");
|
||||
}
|
||||
sleep(2);
|
||||
}
|
||||
ExecCommand("mv tmplog/DTtermLog* ."); sleep(1);
|
||||
ExecCommand("mv tmplog/Term.Log ."); sleep(1);
|
||||
ExecCommand("rmdir tmplog");
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rlogin/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rlogin/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:38 drk $
|
||||
PROGRAMS = Rlogin
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rlogin.c
|
||||
|
||||
OBJS = Rlogin.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
22
cde/programs/dtterm/tests/Rlogin/README
Normal file
22
cde/programs/dtterm/tests/Rlogin/README
Normal file
@@ -0,0 +1,22 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:22:27 drk $ */
|
||||
TestName: Rlogin
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"loginShell True",
|
||||
"loginShell False",
|
||||
"loginShell on",
|
||||
"loginShell off",
|
||||
|
||||
and invokes either one the scripts (test-ls, test+ls)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
124
cde/programs/dtterm/tests/Rlogin/Rlogin.c
Normal file
124
cde/programs/dtterm/tests/Rlogin/Rlogin.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/* $XConsortium: Rlogin.c /main/3 1995/10/31 11:52:58 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resource Option: loginShell True",
|
||||
/*1*/ "Testing Resource Option: loginShell False",
|
||||
/*2*/ "Testing Resource Option: loginShell on",
|
||||
/*3*/ "Testing Resource Option: loginShell off",
|
||||
};
|
||||
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "loginShell True",
|
||||
/*1*/ "loginShell False",
|
||||
/*2*/ "loginShell on",
|
||||
/*2*/ "loginShell off",
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path, *CurDir;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
Path = getenv("PATH");
|
||||
CurDir = getenv("PWD");
|
||||
ExecCommand("PATH=.:../bin:../util:/usr/bin/X11:/bin:/opt/dt/bin");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
strcpy(Command, CurDir); strcat(Command, "/../util/");
|
||||
switch (i) {
|
||||
case 0:
|
||||
strcat(Command, "test-ls");
|
||||
ExecCommand(Command); break;
|
||||
case 1:
|
||||
strcat(Command, "test+ls");
|
||||
ExecCommand(Command); break;
|
||||
case 2:
|
||||
strcat(Command, "test-ls");
|
||||
ExecCommand(Command); break;
|
||||
case 3:
|
||||
strcat(Command, "test+ls");
|
||||
ExecCommand(Command); break;
|
||||
}
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
strcpy(Command, "PATH=");
|
||||
strcat(Command, Path);
|
||||
ExecCommand(Command);
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rpointer/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rpointer/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:46 drk $
|
||||
PROGRAMS = Rpointer
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rpointer.c
|
||||
|
||||
OBJS = Rpointer.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Rpointer/README
Normal file
24
cde/programs/dtterm/tests/Rpointer/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:22:51 drk $ */
|
||||
TestName: Rpointer
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"pointerBlank True pointerBlankDelay 5 pointerColor red
|
||||
pointerColorBackground black pointerShape hand1",
|
||||
"pointerBlank False pointerBlankDelay 5 pointerColor blue
|
||||
pointerColorBackground green pointerShape hand2"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
107
cde/programs/dtterm/tests/Rpointer/Rpointer.c
Normal file
107
cde/programs/dtterm/tests/Rpointer/Rpointer.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/* $XConsortium: Rpointer.c /main/3 1995/10/31 11:53:23 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
void TestPointer(WinName, String, TestNum, Delay)
|
||||
char *WinName, *String;
|
||||
int TestNum, Delay;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sleep(Delay+1);
|
||||
sprintf(Str, "%srpointer%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "pointerBlank True pointerBlankDelay 5 pointerColor red pointerColorBackground black pointerShape hand1",
|
||||
/*1*/ "pointerBlank False pointerBlankDelay 5 pointerColor blue pointerColorBackground greem pointerShape hand2"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Resource Option: pointerBlank True pointerBlankDelay 5 pointerColor red pointerColorBackground black pointerShape hand1",
|
||||
"Testing Resource Option: pointerBlank False pointerBlankDelay 5 pointerColor blue pointerColorBackground greem pointerShape hand2"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
ExecCommand(Command);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestPointer("TermWin", "Checking Pointer Resources ", i+1, 5);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rsavelines/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rsavelines/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:54 drk $
|
||||
PROGRAMS = Rsavelines
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rsavelines.c
|
||||
|
||||
OBJS = Rsavelines.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
cde/programs/dtterm/tests/Rsavelines/README
Normal file
26
cde/programs/dtterm/tests/Rsavelines/README
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:23:16 drk $ */
|
||||
TestName: Rsavelines
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"saveLines 24l",
|
||||
"saveLines 48l",
|
||||
"saveLines 96l",
|
||||
"saveLines 1s",
|
||||
"saveLines 2s",
|
||||
"saveLines 4s"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
130
cde/programs/dtterm/tests/Rsavelines/Rsavelines.c
Normal file
130
cde/programs/dtterm/tests/Rsavelines/Rsavelines.c
Normal file
@@ -0,0 +1,130 @@
|
||||
/* $XConsortium: Rsavelines.c /main/3 1995/10/31 11:53:46 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestSavelines(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
ExecWinCommand(WinName, "printlines");
|
||||
sleep(2);
|
||||
for (i=0; i < 4; i++) PressPrevKey(WinName);
|
||||
sleep(2);
|
||||
sprintf(Str, "%srsavelines%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
sleep(2);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*1*/ " -sl 24l",
|
||||
/*2*/ " -sl 48l",
|
||||
/*3*/ " -sl 96l",
|
||||
/*4*/ " -sl 1s",
|
||||
/*5*/ " -sl 2s",
|
||||
/*6*/ " -sl 4s"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*1*/ "Testing Resource Option: saveLines 24l",
|
||||
/*2*/ "Testing Resource Option: saveLines 48l",
|
||||
/*3*/ "Testing Resource Option: saveLines 96l",
|
||||
/*4*/ "Testing Resource Option: saveLines 1s",
|
||||
/*5*/ "Testing Resource Option: saveLines 2s",
|
||||
/*6*/ "Testing Resource Option: saveLines 4s"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*1*/ "saveLines 24l",
|
||||
/*2*/ "saveLines 48l",
|
||||
/*3*/ "saveLines 96l",
|
||||
/*4*/ "saveLines 1s",
|
||||
/*5*/ "saveLines 2s",
|
||||
/*6*/ "saveLines 4s"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestSavelines("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rscrolltitle/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rscrolltitle/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:02 drk $
|
||||
PROGRAMS = Rscrolltitle
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rscrolltitle.c
|
||||
|
||||
OBJS = Rscrolltitle.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Rscrolltitle/README
Normal file
24
cde/programs/dtterm/tests/Rscrolltitle/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:23:56 drk $ */
|
||||
TestName: Rscrolltitle
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"scrollBar True title TITLE1",
|
||||
"scrollBar False title title2",
|
||||
"scrollBar on title TITLE3",
|
||||
"scrollBar off title title4"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
119
cde/programs/dtterm/tests/Rscrolltitle/Rscrolltitle.c
Normal file
119
cde/programs/dtterm/tests/Rscrolltitle/Rscrolltitle.c
Normal file
@@ -0,0 +1,119 @@
|
||||
/* $XConsortium: Rscrolltitle.c /main/3 1995/10/31 11:54:12 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestScrollbar(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%srscrolltitle%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -sb -title TITLE1",
|
||||
/*1*/ " +sb -title title2",
|
||||
/*2*/ " -xrm 'dtterm*scrollBar: False' -sb -title TITLE3",
|
||||
/*3*/ " -xrm 'dtterm*scrollBar: True' +sb -title title4"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resource Option: scrollBar True title TITLE1",
|
||||
/*1*/ "Testing Resource Option: scrollBar False title title2",
|
||||
/*2*/ "Testing Resource Option: scrollBar on title TITLE3",
|
||||
/*3*/ "Testing Resource Option: scrollBar off title title4",
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "scrollBar True title TITLE1",
|
||||
/*1*/ "scrollBar False title title2",
|
||||
/*2*/ "scrollBar on title TITLE3",
|
||||
/*3*/ "scrollBar off title title4"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestScrollbar("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rtm/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rtm/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:11 drk $
|
||||
PROGRAMS = Rtm
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rtm.c
|
||||
|
||||
OBJS = Rtm.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
20
cde/programs/dtterm/tests/Rtm/README
Normal file
20
cde/programs/dtterm/tests/Rtm/README
Normal file
@@ -0,0 +1,20 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:24:24 drk $ */
|
||||
TestName: Rtm
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
ttyModes: intr ! quit @ erase # kill $ eof % eol ^ swtch & start *
|
||||
stop ( susp ) dsusp _
|
||||
|
||||
and invokes a program termget to verify the functionality
|
||||
and logs whatever is not set.
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
88
cde/programs/dtterm/tests/Rtm/Rtm.c
Normal file
88
cde/programs/dtterm/tests/Rtm/Rtm.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/* $XConsortium: Rtm.c /main/3 1995/10/31 11:54:45 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -tm 'intr ! quit @ erase # kill $ eof % eol ^ swtch & start * stop ( susp ) dsusp _'" /* Normal option */
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resource Option -tm "
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
"intr ! quit @ erase # kill $ eof % eol ^ swtch & start * stop ( susp ) dsusp _"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, "ttyModes", ResourceArr[0]);
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
ExecCommand("termget");
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rvisualbell/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rvisualbell/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:19 drk $
|
||||
PROGRAMS = Rvisualbell
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rvisualbell.c
|
||||
|
||||
OBJS = Rvisualbell.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
20
cde/programs/dtterm/tests/Rvisualbell/README
Normal file
20
cde/programs/dtterm/tests/Rvisualbell/README
Normal file
@@ -0,0 +1,20 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:24:53 drk $ */
|
||||
TestName: Rvisualbell
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
|
||||
"visualBell True",
|
||||
"visualBell False ",
|
||||
"visualBell on ",
|
||||
"visualBell off "
|
||||
|
||||
this has to be verified mannually
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
124
cde/programs/dtterm/tests/Rvisualbell/Rvisualbell.c
Normal file
124
cde/programs/dtterm/tests/Rvisualbell/Rvisualbell.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/* $XConsortium: Rvisualbell.c /main/3 1995/10/31 11:55:11 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestVisualbell(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
for (i=0; i < 4; i++)
|
||||
PressCtrlGKey(WinName);
|
||||
if ((TestNum % 2) == 0)
|
||||
PrintTermString(WinName, "You should have heard beep");
|
||||
else
|
||||
PrintTermString(WinName, "You should have seen screen flashing");
|
||||
sleep(5);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -vb ",
|
||||
/*1*/ " -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " +vb ",
|
||||
/*3*/ " -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ " Testing Option: -vb ",
|
||||
/*1*/ " Testing Option: -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " Testing Option: +vb ",
|
||||
/*3*/ " Testing Option: -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "visualBell True",
|
||||
/*1*/ "visualBell False ",
|
||||
/*2*/ "visualBell on ",
|
||||
/*3*/ "visualBell off "
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestVisualbell("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rwrap/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rwrap/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:28 drk $
|
||||
PROGRAMS = Rwrap
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rwrap.c
|
||||
|
||||
OBJS = Rwrap.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Rwrap/README
Normal file
23
cde/programs/dtterm/tests/Rwrap/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:25:23 drk $ */
|
||||
TestName: Rwrap
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"autoWrap True reverseWrap True ",
|
||||
"autoWrap False reverseWrap False ",
|
||||
"autoWrap True reverseWrap False "
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
111
cde/programs/dtterm/tests/Rwrap/Rwrap.c
Normal file
111
cde/programs/dtterm/tests/Rwrap/Rwrap.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/* $XConsortium: Rwrap.c /main/3 1995/10/31 11:55:31 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
void TestWrap(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
PressKeyNtimes(WinName, "C", 100);
|
||||
for (i=0; i < 75; i++)
|
||||
PressBackSpace(WinName);
|
||||
sprintf(Str, "%srwrap%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "autoWrap True reverseWrap True ",
|
||||
/*1*/ "autoWrap False reverseWrap False ",
|
||||
/*2*/ "autoWrap True reverseWrap False "
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Resource Option: autoWrap True reverseWrap True ",
|
||||
"Testing Resource Option:autoWrap False reverseWrap False ",
|
||||
"Testing Resource Option:autoWrap True reverseWrap False "
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestWrap("TermWin", "Checking Pointer Resources ", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/charatt/Imakefile
Normal file
51
cde/programs/dtterm/tests/charatt/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:37 drk $
|
||||
PROGRAMS = charatt
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = charatt.c
|
||||
|
||||
OBJS = charatt.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
25
cde/programs/dtterm/tests/charatt/README
Normal file
25
cde/programs/dtterm/tests/charatt/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:25:49 drk $ */
|
||||
TestName: charatt
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[0m"
|
||||
"\033[1m"
|
||||
"\033[4m"
|
||||
"\033[5m"
|
||||
"\033[7m"
|
||||
"\0337"
|
||||
"\0338"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
150
cde/programs/dtterm/tests/charatt/charatt.c
Normal file
150
cde/programs/dtterm/tests/charatt/charatt.c
Normal file
@@ -0,0 +1,150 @@
|
||||
/* $XConsortium: charatt.c /main/3 1995/10/31 11:55:53 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
#define Normal 0
|
||||
#define Bold 1
|
||||
#define Underscore 2
|
||||
#define Inverse 3
|
||||
#define Blink 4
|
||||
|
||||
static char *DispAttArr[] = {"Normal","Bold", "Underscore", "Inverse", "Blink"};
|
||||
|
||||
static SetDispAttr(WhichAttr, NewLine, BlinkOn)
|
||||
int WhichAttr;
|
||||
Bool NewLine, BlinkOn;
|
||||
{
|
||||
switch (WhichAttr) {
|
||||
case Normal:
|
||||
SetDispNormal(); break;
|
||||
case Bold:
|
||||
SetDispBold(); break;
|
||||
case Underscore:
|
||||
SetDispUnderscore(); break;
|
||||
case Inverse:
|
||||
SetDispInverse(); break;
|
||||
}
|
||||
if (BlinkOn == True) SetDispBlink();
|
||||
WRITETEST(DispAttArr[WhichAttr]);
|
||||
if (NewLine == True) {
|
||||
NextLine();
|
||||
SetDispNormal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TestDispAtt(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i, j, k, Lines, Cols;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
Bool BlinkOn;
|
||||
|
||||
ClearScreen();
|
||||
for (i=0; i < 2; i++) {
|
||||
if (i == 1) BlinkOn = True;
|
||||
else BlinkOn = False;
|
||||
SetDispAttr(Normal, True, BlinkOn);
|
||||
SetDispAttr(Bold, True, BlinkOn);
|
||||
SetDispAttr(Underscore, True, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
SetDispAttr(Bold, False, BlinkOn);
|
||||
SetDispAttr(Underscore, True, BlinkOn);
|
||||
SetDispAttr(Bold, False, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
SetDispAttr(Bold, False, BlinkOn);
|
||||
SetDispAttr(Underscore, False, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
SetDispAttr(Underscore, False, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scharatt1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetDispNormal();
|
||||
FLUSHTEST();
|
||||
}
|
||||
|
||||
void TestCursor(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
SetScrollRegn(5, 15);
|
||||
SetDispBold();
|
||||
SetDispInverse();
|
||||
SetDispUnderscore();
|
||||
SetOriginMode(DECModeSet); /* To Origin Mode */
|
||||
SetWrapMode(DECModeSet);
|
||||
AbsoluteGoToXY(46, 14);
|
||||
SaveCursor();
|
||||
SetDispNormal();
|
||||
SetOriginMode(DECModeReset);
|
||||
SetWrapMode(DECModeReset);
|
||||
ClearScreen();
|
||||
WRITETEST("Now In Normal Char Att; Cursor Mode; in Line 1; with no wrap and on restoring cursor");
|
||||
NextLine();
|
||||
WRITETEST("You did not see full line because of no wrap;On Restoring Cursor");
|
||||
RestoreCursor();
|
||||
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");
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scharatt2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ResetTerm(Cols)
|
||||
int Cols;
|
||||
{
|
||||
SetDispNormal();
|
||||
SetOriginMode(DECModeReset);
|
||||
SetScrollRegn(1, Cols);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
int NumLines, NumCols;
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&NumLines, &NumCols);
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestDispAtt("TermWin");
|
||||
#ifdef SLOW
|
||||
sleep(10);
|
||||
#endif
|
||||
TestCursor("TermWin");
|
||||
ResetTerm(NumCols);
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
DONE();
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/curmove/Imakefile
Normal file
51
cde/programs/dtterm/tests/curmove/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:45 drk $
|
||||
PROGRAMS = curmove
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = curmove.c
|
||||
|
||||
OBJS = curmove.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
cde/programs/dtterm/tests/curmove/README
Normal file
32
cde/programs/dtterm/tests/curmove/README
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:26:14 drk $ */
|
||||
TestName: curmove
|
||||
|
||||
Description: This program tests the cursor movement functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[A"
|
||||
"\033[%dA"
|
||||
"\033[B"
|
||||
"\033[%dB"
|
||||
"\033[%dC"
|
||||
"\033[%dD"
|
||||
"\033[%d;%dH"
|
||||
"\033[%d;%df"
|
||||
"\033[%dF"
|
||||
"\033[%dG"
|
||||
"\033[6n"
|
||||
"\033[%d;%dR"
|
||||
|
||||
note: %d means a parameter
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
149
cde/programs/dtterm/tests/curmove/curmove.c
Normal file
149
cde/programs/dtterm/tests/curmove/curmove.c
Normal file
@@ -0,0 +1,149 @@
|
||||
/* $XConsortium: curmove.c /main/3 1995/10/31 11:56:15 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
#define InitArr(Arr, NumCols, NumLines) \
|
||||
{ \
|
||||
for (i=0; i < NumCols; i++) \
|
||||
for (j=0; j < NumLines; j++) Arr[i][j] = 0; \
|
||||
}
|
||||
|
||||
void TestCurMove(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
|
||||
int i,j, Count=0, Position, Arr[200][100];
|
||||
int CurrX, CurrY, PrevX, PrevY, GotX, GotY;
|
||||
int Relative=1, Wrap=0, NumLines, NumCols;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&NumLines, &NumCols);
|
||||
#ifdef DEBUG
|
||||
sprintf(LogStr, "WINDOW Size Cols: %d Lines: %d \n", NumCols, NumLines);
|
||||
LogError(LogStr);
|
||||
#endif
|
||||
ClearScreen(); InitArr(Arr, NumCols, NumLines);
|
||||
PrevX = 0; PrevY = 0;
|
||||
while (1) {
|
||||
CurrX = (int) (rand() % NumCols);
|
||||
CurrY = (int) (rand() % NumLines);
|
||||
if (Arr[CurrX][CurrY] == 1) continue;
|
||||
if ((CurrX == PrevX) && (CurrY == PrevY)) continue;
|
||||
if (Relative == 1) RelativeGoToXY(PrevX, PrevY, CurrX, CurrY);
|
||||
else if (Relative == 2) AbsoluteGoToXY(CurrX+1, CurrY+1);
|
||||
else AbsoluteGoToXY_HVP(CurrX+1, CurrY+1);
|
||||
Arr[CurrX][CurrY] = 1;
|
||||
if (CurrX != (NumCols - 1))
|
||||
{WRITETEST("0"); CursorBack(1);}
|
||||
else {
|
||||
WRITETEST("0");
|
||||
if (Wrap == 1) AbsoluteGoToXY(CurrX+1, CurrY+1);
|
||||
}
|
||||
GetCursorPosn(&GotX, &GotY);
|
||||
if ((CurrX != (GotX - 1)) || (CurrY != (GotY -1))) {
|
||||
if (Relative == 1) printf("Relative :");
|
||||
else printf("Absolute:");
|
||||
sprintf(LogStr, "Expeted X Y: %3d %3d Got X Y: %3d %3d \n",
|
||||
CurrX+1, CurrY+1, GotX, GotY);
|
||||
printf("%s", LogStr); LogError(LogStr);
|
||||
DONE(); return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
sprintf(LogStr, "CurrX: %3d CurrY: %3d GotX: %3d GotY: %3d \n",
|
||||
CurrX+1, CurrY+1, GotX, GotY);
|
||||
LogError(LogStr);
|
||||
#endif
|
||||
PrevX= CurrX; PrevY = CurrY;
|
||||
Count++;
|
||||
if (Count >= ( NumLines *NumCols)) {
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scurmove%d", IMAGE_DIR, Relative);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
if ((Relative == 1) || (Relative == 2)) {
|
||||
ClearScreen(); InitArr(Arr, NumCols, NumLines);
|
||||
Relative += 1; Count = 0;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
}
|
||||
DONE();
|
||||
}
|
||||
|
||||
#define STARLEN 120
|
||||
|
||||
void TestCurColLine(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i, Cols, Lines;
|
||||
char Str[STARLEN];
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&Lines, &Cols);
|
||||
ClearScreen(); HomeUp();
|
||||
CursorDown(Lines);
|
||||
CursorPrevLine(Lines/2 + 1);
|
||||
CursorColumn(Cols/10);
|
||||
for (i=0; i < (STARLEN/2); i++) Str[i] = '*';
|
||||
Str[STARLEN/2] = NULLCHAR;
|
||||
WRITETEST(Str);
|
||||
NextLine();
|
||||
CursorColumn(Cols/10);
|
||||
WRITETEST("*");
|
||||
CursorColumn(((Cols/10) + (STARLEN/2) - 1));
|
||||
WRITETEST("*");
|
||||
NextLine();
|
||||
CursorColumn(Cols/10);
|
||||
WRITETEST(Str);
|
||||
CursorPrevLine(1);
|
||||
CursorColumn((Cols/10) + (Cols/20));
|
||||
WRITETEST("DO YOU SEE A BOX USING * IN THE CENTER ENCLOSING THIS");
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scurmove4", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestCurMove("TermWin");
|
||||
TestCurColLine("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
2
cde/programs/dtterm/tests/data/dtterm.object
Normal file
2
cde/programs/dtterm/tests/data/dtterm.object
Normal file
@@ -0,0 +1,2 @@
|
||||
Location LocTerm 400 400
|
||||
Location LocTerm1 200 200
|
||||
52
cde/programs/dtterm/tests/decmode/Imakefile
Normal file
52
cde/programs/dtterm/tests/decmode/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:53 drk $
|
||||
PROGRAMS = decmode
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = decmode.c
|
||||
|
||||
OBJS = decmode.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
56
cde/programs/dtterm/tests/decmode/README
Normal file
56
cde/programs/dtterm/tests/decmode/README
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:26:42 drk $ */
|
||||
TestName: decmode
|
||||
|
||||
Description: This program tests the DECMODE functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
|
||||
"\033[%d;%dr"
|
||||
"\033[?1h"
|
||||
"\033[?3h"
|
||||
"\033[?4h"
|
||||
"\033[?5h"
|
||||
"\033[?6h"
|
||||
"\033[?7h"
|
||||
"\033[?44h"
|
||||
"\033[?45h"
|
||||
"\033[?46h"
|
||||
"\033[?1l"
|
||||
"\033[?3l"
|
||||
"\033[?4l"
|
||||
"\033[?5l"
|
||||
"\033[?6l"
|
||||
"\033[?7l"
|
||||
"\033[?44l"
|
||||
"\033[?45l"
|
||||
"\033[?46l"
|
||||
"\033[?1s"
|
||||
"\033[?3s"
|
||||
"\033[?4s"
|
||||
"\033[?5s"
|
||||
"\033[?6s"
|
||||
"\033[?7s"
|
||||
"\033[?44s"
|
||||
"\033[?45s"
|
||||
"\033[?46s"
|
||||
"\033[?1r"
|
||||
"\033[?3r"
|
||||
"\033[?4r"
|
||||
"\033[?5r"
|
||||
"\033[?6r"
|
||||
"\033[?7r"
|
||||
"\033[?44r"
|
||||
"\033[?45r"
|
||||
"\033[?46r"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
206
cde/programs/dtterm/tests/decmode/decmode.c
Normal file
206
cde/programs/dtterm/tests/decmode/decmode.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/* $XConsortium: decmode.c /main/3 1995/10/31 11:56:41 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void FillScrLnNumbers(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, j;
|
||||
char Str[10];
|
||||
HomeUp(); ClearScreen();
|
||||
for (i=0; i < Lines; i++) {
|
||||
sprintf(Str, "%x", (i % 15) +1);
|
||||
for (j=0; j < Cols; j++) WRITETEST(Str);
|
||||
}
|
||||
}
|
||||
|
||||
void TestScrollRegn(Lines, Cols, ScrollTop, ScrollBottom, WinName, ImageFile)
|
||||
int Lines, Cols, ScrollTop, ScrollBottom;
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
ClearScreen();
|
||||
SetScrollRegn(ScrollTop, ScrollBottom);
|
||||
SetOriginMode(DECModeSet); /* To Origin Mode */
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sA", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetOriginMode(DECModeSave); /* Save the mode set (Origin Mode) */
|
||||
SetOriginMode(DECModeReset); /* Set the mode to cursor mode */
|
||||
ClearScreen();
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sB", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
ClearScreen();
|
||||
SetOriginMode(DECModeRestore); /* Restore the saved mode (Origin Mode)*/
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sC", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TestReverseWrap(Lines, Cols, WinName, ImageFile)
|
||||
int Lines, Cols;
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
SetScrollRegn(1, Lines);
|
||||
SetOriginMode(DECModeReset);
|
||||
SetWrapMode(DECModeSet);
|
||||
SetWrapMode(DECModeSave);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
SetReverseWrap(DECModeSet);
|
||||
SetReverseWrap(DECModeSave);
|
||||
CursorBack((Lines*Cols) / 2);
|
||||
InsertBlanks(Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sA", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetReverseWrap(DECModeReset);
|
||||
SetWrapMode(DECModeReset);
|
||||
CursorForward(Cols*Lines);
|
||||
CursorBack((Lines*Cols));
|
||||
sleep(10);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sB", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetWrapMode(DECModeRestore);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
SetReverseWrap(DECModeRestore);
|
||||
BackSpace(((Lines*Cols) / 2) + 1);
|
||||
InsertBlanks(Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sC", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TestReverseVideo(Lines, Cols, WinName, ImageFile)
|
||||
int Lines, Cols;
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
SetOriginMode(DECModeReset);
|
||||
SetWrapMode(DECModeSet);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
SetVideoType(DECModeSet);
|
||||
SetVideoType(DECModeSave);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sA", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetVideoType(DECModeReset);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sB", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetVideoType(DECModeRestore);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sC", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetVideoType(DECModeReset);
|
||||
}
|
||||
|
||||
void WriteTwiceCols(Cols)
|
||||
int Cols;
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < (2*Cols); i++)
|
||||
if (i <= Cols) WRITETEST("a");
|
||||
else WRITETEST("b");
|
||||
}
|
||||
|
||||
void TestDECMode(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int Lines, Cols, GotX, GotY;
|
||||
char Str1[IMAGE_FILE_LEN], Str2[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
sprintf(Str1, "%sdecmode1", IMAGE_DIR);
|
||||
TestScrollRegn(Lines, Cols, 5, 15, WinName, Str1);
|
||||
sprintf(Str1, "%sdecmode2", IMAGE_DIR);
|
||||
TestScrollRegn(Lines, Cols, 3, 23, WinName, Str1);
|
||||
SetWrapMode(DECModeReset);
|
||||
ClearScreen();
|
||||
WriteTwiceCols(Cols);
|
||||
GetCursorPosn(&GotX, &GotY);
|
||||
if (GotX != Cols) LogError("WrapMode Off failed");
|
||||
else LogError("WrapMode Off Success");
|
||||
NextLine();
|
||||
WriteTwiceCols(Cols);
|
||||
GetCursorPosn(&GotX, &GotY);
|
||||
if (GotX != Cols) LogError("WrapMode Off failed");
|
||||
else LogError("WrapMode Off Success");
|
||||
sprintf(Str1, "%sdecmode3", IMAGE_DIR);
|
||||
TestReverseWrap(Lines, Cols, WinName, Str1);
|
||||
sprintf(Str1, "%sdecmode4", IMAGE_DIR);
|
||||
TestReverseVideo(Lines, Cols, WinName, Str1);
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestDECMode("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/edittest/Imakefile
Normal file
52
cde/programs/dtterm/tests/edittest/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:03 drk $
|
||||
PROGRAMS = edittest
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = edittest.c
|
||||
|
||||
OBJS = edittest.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
28
cde/programs/dtterm/tests/edittest/README
Normal file
28
cde/programs/dtterm/tests/edittest/README
Normal file
@@ -0,0 +1,28 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:27:09 drk $ */
|
||||
TestName: edittest
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033D"
|
||||
"\033M"
|
||||
"\033E"
|
||||
"\033[%dL"
|
||||
"\033[%d@"
|
||||
"\033[%dM"
|
||||
"\033[%dP"
|
||||
"\033[4h"
|
||||
"\033[4l"
|
||||
note: %d means a parameter
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
312
cde/programs/dtterm/tests/edittest/edittest.c
Normal file
312
cde/programs/dtterm/tests/edittest/edittest.c
Normal file
@@ -0,0 +1,312 @@
|
||||
/* $XConsortium: edittest.c /main/3 1995/10/31 11:57:08 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void FillScrLnNumbers(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, j;
|
||||
char Str[10];
|
||||
HomeUp(); ClearScreen();
|
||||
for (i=0; i < Lines; i++) {
|
||||
sprintf(Str, "%x", (i % 15) +1);
|
||||
for (j=0; j < Cols; j++) WRITETEST(Str);
|
||||
}
|
||||
}
|
||||
|
||||
void FillHalfScrLnNumbers(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, j;
|
||||
char Str[10];
|
||||
HomeUp(); ClearScreen();
|
||||
for (i=0; i < Lines; i++) {
|
||||
sprintf(Str, "%x", (i % 15) +1);
|
||||
for (j=0; j < Cols/2; j++) WRITETEST(Str);
|
||||
if (i != (Lines-1)) NextLine();
|
||||
}
|
||||
}
|
||||
|
||||
void InsertTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count=5; char Str[100];
|
||||
|
||||
for (i=0; i < Count; i++) NextLine();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
InsertLines(1);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
sprintf(Str,"CameDown by %d Lines and inserted this line", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 10;
|
||||
for (i=0; i < Count; i++) NextLine();
|
||||
InsertLines(2);
|
||||
sprintf(Str,"CameDown by %d Lines and inserted two lines ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IndexTest(Lines)
|
||||
int Lines;
|
||||
{
|
||||
int i; char Str[100];
|
||||
HomeUp();
|
||||
for (i=0; i < Lines; i++) Index();
|
||||
InsertLines(1);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
sprintf(Str,"Screen Should have scrolled by a line; let me scroll two more");
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Index(); Index();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ReverseIndexTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count; char Str[100];
|
||||
for (i=0; i < Lines; i++) ReverseIndex();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 1;
|
||||
for (i=0; i < Count; i++) ReverseIndex();
|
||||
InsertLines(1); CursorBack(Cols);
|
||||
sprintf(Str,"Screen should have scrolled down by 3 lines;");
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 2;
|
||||
ReverseIndex();
|
||||
CursorBack(Cols);
|
||||
sprintf(Str,"Let me scroll %d more ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
for (i=0; i < Count; i++) ReverseIndex();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DeleteLnTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count=10; char Str[100];
|
||||
sleep(2);
|
||||
FLUSHTEST();
|
||||
CursorBack(Cols);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
CursorUp(Count);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
DeleteLines(2);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
InsertLines(1);
|
||||
sprintf(Str,"CameUp by %d Lines and deleted two lines ", Count);
|
||||
WRITETEST(Str);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
CursorBack(Cols);
|
||||
Count = 5;
|
||||
CursorUp(Count);
|
||||
DeleteLines(1);
|
||||
InsertLines(1);
|
||||
sprintf(Str,"CameUp by %d Lines and deleted a line ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DeleteCharTest()
|
||||
{
|
||||
int i, Count=3; char Str[100];
|
||||
CursorUp(Count);
|
||||
CursorBack(20);
|
||||
DeleteChars(10); NextLine();
|
||||
InsertLines(1);
|
||||
sprintf(Str, "Came Up %d lines and deleted ten charactes; ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 2;
|
||||
CursorBack(20);
|
||||
CursorUp(Count);
|
||||
DeleteChars(90); NextLine();
|
||||
InsertLines(1);
|
||||
sprintf(Str,"Came Up %d lines and tried to delete 90 chars", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void InsertCharTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count;
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
CursorForward(Cols/2);
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorBack(1); DeleteChars(i*2+1);
|
||||
#ifdef SLOW
|
||||
FLUSHTEST(); sleep(1);
|
||||
#endif
|
||||
InsertBlanks(i*2+1); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
FLUSHTEST(); sleep(1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void InsertReplTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i;
|
||||
FillHalfScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < (Lines/2); i++) {
|
||||
CursorForward(2*i+1);
|
||||
SetInsertMode();
|
||||
WRITETEST("Now In Insert Mode");
|
||||
NextLine(); CursorBack(Cols);
|
||||
CursorForward(2*i+1);
|
||||
SetReplaceMode();
|
||||
WRITETEST("Now In Repalce Mode");
|
||||
if (i != ((Lines/2) -1)) {NextLine(); CursorBack(Cols);}
|
||||
}
|
||||
FLUSHTEST();
|
||||
}
|
||||
|
||||
#define FILLSCR \
|
||||
sleep(5); \
|
||||
FillScrLnNumbers(Lines, Cols); \
|
||||
FLUSHTEST(); \
|
||||
sleep(5);
|
||||
|
||||
|
||||
void TestAllEdit(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i,j,k, l, Wrap;
|
||||
int Lines, Cols, TabSpace, TabCount;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
FILLSCR;
|
||||
HomeUp();
|
||||
InsertTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
IndexTest(Lines);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
DeleteLnTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit3", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
DeleteCharTest();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit4", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
ReverseIndexTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit5", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
InsertCharTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit6", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
InsertReplTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit7", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestAllEdit("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/erase/Imakefile
Normal file
52
cde/programs/dtterm/tests/erase/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:12 drk $
|
||||
PROGRAMS = erase
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = erase.c
|
||||
|
||||
OBJS = erase.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
25
cde/programs/dtterm/tests/erase/README
Normal file
25
cde/programs/dtterm/tests/erase/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:27:33 drk $ */
|
||||
TestName: erase
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[J"
|
||||
"\033[1J"
|
||||
"\033[2J"
|
||||
"\033[K"
|
||||
"\033[1K"
|
||||
"\033[2K"
|
||||
"\033[%dX"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
185
cde/programs/dtterm/tests/erase/erase.c
Normal file
185
cde/programs/dtterm/tests/erase/erase.c
Normal file
@@ -0,0 +1,185 @@
|
||||
/* $XConsortium: erase.c /main/3 1995/10/31 11:57:36 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void FillScreen(Lines, Cols, Ch)
|
||||
int Lines, Cols;
|
||||
char Ch;
|
||||
{
|
||||
int i, j; char Str[10];
|
||||
ClearScreen();
|
||||
sprintf(Str, "%c", Ch);
|
||||
for (i=0; i < Lines; i++)
|
||||
for (j=0; j < Cols; j++)
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void EraseLnTest(Lines, Cols, WinName)
|
||||
int Lines, Cols;
|
||||
char *WinName;
|
||||
{
|
||||
int i; char Str[IMAGE_FILE_LEN];
|
||||
FillScreen(Lines, Cols, 'X');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorForward(1); EraseLnFromCur(); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
HomeUp();
|
||||
FillScreen(Lines, Cols, 'M');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorForward(1); EraseLnToCur(); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
HomeUp();
|
||||
FillScreen(Lines, Cols, 'M');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < (Lines/2); i++) {
|
||||
CursorForward(2); EraseLnAll(); CursorDown(2);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase3", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define MoveBy 5
|
||||
|
||||
void EraseScrTest(Lines, Cols, WinName)
|
||||
int Lines, Cols;
|
||||
char *WinName;
|
||||
{
|
||||
int i, Count;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
FillScreen(Lines, Cols, 'R');
|
||||
FLUSHTEST();
|
||||
Count = Lines / MoveBy;
|
||||
for (i=0; i < Count; i++) {
|
||||
CursorBack(((Cols-MoveBy) /Count)); CursorUp(MoveBy);
|
||||
EraseScrFromCur();
|
||||
#ifdef SLOW
|
||||
sleep(2); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
sprintf(Str, "%serase4", IMAGE_DIR);
|
||||
#ifdef SYNLIB
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
ClearScreen();
|
||||
FillScreen(Lines, Cols, 'M');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < Count; i++) {
|
||||
CursorForward(((Cols-MoveBy) /Count)); CursorDown(MoveBy);
|
||||
EraseScrToCur();
|
||||
#ifdef SLOW
|
||||
sleep(2); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase5", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void EraseCharTest(Lines, Cols, WinName)
|
||||
int Lines, Cols;
|
||||
char *WinName;
|
||||
{
|
||||
int i, Count;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
FillScreen(Lines, Cols, 'R');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
CursorForward(Cols/2);
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorBack(1); EraseChars(i*2+1); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase6", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TestAllErase(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i,j,k, l, Wrap;
|
||||
int Lines, Cols, TabSpace, TabCount;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0, 0);
|
||||
/*
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
*/
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
EraseLnTest(Lines, Cols, WinName);
|
||||
EraseScrTest(Lines, Cols, WinName);
|
||||
EraseCharTest(Lines, Cols, WinName);
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestAllErase("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/keypad/Imakefile
Normal file
52
cde/programs/dtterm/tests/keypad/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:21 drk $
|
||||
PROGRAMS = keypad
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = keypad.c
|
||||
|
||||
OBJS = keypad.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
cde/programs/dtterm/tests/keypad/README
Normal file
21
cde/programs/dtterm/tests/keypad/README
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:27:57 drk $ */
|
||||
TestName: keypad
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
|
||||
"\033="
|
||||
"\033>"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
66
cde/programs/dtterm/tests/keypad/keypad.c
Normal file
66
cde/programs/dtterm/tests/keypad/keypad.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $XConsortium: keypad.c /main/3 1995/10/31 11:58:09 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestKeypad(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i, Lines, Cols;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0, 1);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols); HomeUp();
|
||||
for (i=0; i < 2; i++) {
|
||||
SetNormalKeyPad();
|
||||
PressKeypadKeys();
|
||||
NextLine();
|
||||
SetApplnKeyPad();
|
||||
PressKeypadKeys();
|
||||
NextLine();
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%skeypad", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestKeypad("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/scroll/Imakefile
Normal file
52
cde/programs/dtterm/tests/scroll/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:29 drk $
|
||||
PROGRAMS = scroll
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = scroll.c
|
||||
|
||||
OBJS = scroll.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
cde/programs/dtterm/tests/scroll/README
Normal file
21
cde/programs/dtterm/tests/scroll/README
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:28:22 drk $ */
|
||||
TestName: scroll
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[?4h"
|
||||
"\033[?4l"
|
||||
"\033[?4s"
|
||||
"\033[?4r"
|
||||
|
||||
this has to be verified mannually
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
83
cde/programs/dtterm/tests/scroll/scroll.c
Normal file
83
cde/programs/dtterm/tests/scroll/scroll.c
Normal file
@@ -0,0 +1,83 @@
|
||||
/* $XConsortium: scroll.c /main/3 1995/10/31 11:58:41 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void TestScrolling(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
|
||||
int i, NumLines, NumCols;
|
||||
char Str[200];
|
||||
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&NumLines, &NumCols);
|
||||
#ifdef DEBUG
|
||||
sprintf(LogStr, "WINDOW Size Cols: %d Lines: %d \n", NumCols, NumLines);
|
||||
LogError(LogStr);
|
||||
#endif
|
||||
ClearScreen();
|
||||
SetScrollType(DECModeSet);
|
||||
SetScrollType(DECModeSave);
|
||||
for (i=0; i < (20*NumLines); i++) {
|
||||
sprintf(Str, "%s%d", "It's in smooth Scroll Mode. is it right", i);
|
||||
WRITETEST(Str);
|
||||
NextLine();
|
||||
}
|
||||
ClearScreen();
|
||||
sleep(2);
|
||||
SetScrollType(DECModeReset);
|
||||
for (i=0; i < (20*NumLines); i++) {
|
||||
sprintf(Str, "%s%d", "It's in Jump Scroll Mode. is it right", i);
|
||||
WRITETEST(Str);
|
||||
NextLine();
|
||||
}
|
||||
SetScrollType(DECModeRestore);
|
||||
ClearScreen();
|
||||
sleep(2);
|
||||
for (i=0; i < (20*NumLines); i++) {
|
||||
sprintf(Str, "%s%d", "It's in smooth Scroll Mode. is it right", i);
|
||||
WRITETEST(Str);
|
||||
NextLine();
|
||||
}
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestScrolling("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/sgr/Imakefile
Normal file
52
cde/programs/dtterm/tests/sgr/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:40 drk $
|
||||
PROGRAMS = sgr
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = sgr.c
|
||||
|
||||
OBJS = sgr.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
19
cde/programs/dtterm/tests/sgr/README
Normal file
19
cde/programs/dtterm/tests/sgr/README
Normal file
@@ -0,0 +1,19 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:29:02 drk $ */
|
||||
TestName: sgr
|
||||
|
||||
Description: This program tests the SGR functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[%d;%d;%dm"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
145
cde/programs/dtterm/tests/sgr/sgr.c
Normal file
145
cde/programs/dtterm/tests/sgr/sgr.c
Normal file
@@ -0,0 +1,145 @@
|
||||
/* $XConsortium: sgr.c /main/3 1995/10/31 11:59:14 rswiston $ */
|
||||
#include <stdio.h>
|
||||
|
||||
#define CSI "\033["
|
||||
|
||||
#define PRIMARY 0
|
||||
#define BOLD 1
|
||||
#define UNDERSCORE 2
|
||||
#define SLOWBLINK 5
|
||||
#define REVERSE 7
|
||||
#define NORMAL 22
|
||||
#define NOT_UNDERLINE 24
|
||||
#define NOT_BLINKING 25
|
||||
#define POSITIVE_IMAGE 27
|
||||
|
||||
|
||||
#define DISP_BLACK 30
|
||||
#define DISP_RED 31
|
||||
#define DISP_GREEN 32
|
||||
#define DISP_YELLOW 33
|
||||
#define DISP_BLUE 34
|
||||
#define DISP_MAGENTA 35
|
||||
#define DISP_CYAN 36
|
||||
#define DISP_WHITE 37
|
||||
|
||||
#define BACK_BLACK 40
|
||||
#define BACK_RED 41
|
||||
#define BACK_GREEN 42
|
||||
#define BACK_YELLOW 43
|
||||
#define BACK_BLUE 44
|
||||
#define BACK_MAGENTA 45
|
||||
#define BACK_CYAN 46
|
||||
#define BACK_WHITE 47
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
void TestSGR()
|
||||
{
|
||||
char EscStr[20], WriteStr[200], AttStr[30], DispStr[30], BackStr[30];
|
||||
int i, j, k, Attribute, DispColor, BackColor, Count=0;
|
||||
|
||||
for (i=0; i < 8; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
Attribute = BOLD; strcpy(AttStr, "BOLD "); break;
|
||||
case 1:
|
||||
Attribute = UNDERSCORE; strcpy(AttStr, "UNDERSCORE "); break;
|
||||
case 2:
|
||||
Attribute = SLOWBLINK; strcpy(AttStr, "SLOWBLINK "); break;
|
||||
case 3:
|
||||
Attribute = REVERSE; strcpy(AttStr, "REVERSE "); break;
|
||||
case 4:
|
||||
Attribute = NORMAL; strcpy(AttStr, "NORMAL "); break;
|
||||
case 5:
|
||||
Attribute = NOT_UNDERLINE; strcpy(AttStr, "NOT_UNDERLINE "); break;
|
||||
case 6:
|
||||
Attribute = NOT_BLINKING; strcpy(AttStr, "NOT_BLINKING "); break;
|
||||
case 7:
|
||||
Attribute = POSITIVE_IMAGE; strcpy(AttStr, "POSITIVE_IMAGE "); break;
|
||||
}
|
||||
for (j=0; j < 8; j++) {
|
||||
switch (j) {
|
||||
case 0:
|
||||
DispColor = DISP_BLACK; strcpy(DispStr, "DISP_BLACK "); break;
|
||||
case 1:
|
||||
DispColor = DISP_RED; strcpy(DispStr, "DISP_RED "); break;
|
||||
case 2:
|
||||
DispColor = DISP_GREEN; strcpy(DispStr, "DISP_GREEN "); break;
|
||||
case 3:
|
||||
DispColor = DISP_YELLOW; strcpy(DispStr, "DISP_YELLOW "); break;
|
||||
case 4:
|
||||
DispColor = DISP_BLUE; strcpy(DispStr, "DISP_BLUE "); break;
|
||||
case 5:
|
||||
DispColor = DISP_MAGENTA; strcpy(DispStr, "DISP_MAGENTA "); break;
|
||||
case 6:
|
||||
DispColor = DISP_CYAN; strcpy(DispStr, "DISP_CYAN "); break;
|
||||
case 7:
|
||||
DispColor = DISP_WHITE; strcpy(DispStr, "DISP_WHITE "); break;
|
||||
}
|
||||
for (k=0; k < 8; k++) {
|
||||
switch (k) {
|
||||
case 0:
|
||||
BackColor = BACK_BLACK; strcpy(BackStr, "BACK_BLACK "); break;
|
||||
case 1:
|
||||
BackColor = BACK_RED; strcpy(BackStr, "BACK_RED "); break;
|
||||
case 2:
|
||||
BackColor = BACK_GREEN; strcpy(BackStr, "BACK_GREEN "); break;
|
||||
case 3:
|
||||
BackColor = BACK_YELLOW; strcpy(BackStr, "BACK_YELLOW "); break;
|
||||
case 4:
|
||||
BackColor = BACK_BLUE; strcpy(BackStr, "BACK_BLUE "); break;
|
||||
case 5:
|
||||
BackColor = BACK_MAGENTA; strcpy(BackStr, "BACK_MAGENTA "); break;
|
||||
case 6:
|
||||
BackColor = BACK_CYAN; strcpy(BackStr, "BACK_CYAN "); break;
|
||||
case 7:
|
||||
BackColor = BACK_WHITE; strcpy(BackStr, "BACK_WHITE "); break;
|
||||
}
|
||||
sprintf(EscStr, "%s%d;%d;%dm", CSI, Attribute, DispColor, BackColor);
|
||||
WRITETEST(EscStr);
|
||||
sprintf(WriteStr, "%2d;%2d;%2d ", Attribute, DispColor, BackColor);
|
||||
WRITETEST(WriteStr);
|
||||
sprintf(EscStr, "%s0m", CSI);
|
||||
WRITETEST(EscStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
int NumLines, NumCols;
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&NumLines, &NumCols);
|
||||
#ifdef DEBUG
|
||||
sprintf(LogStr, "WINDOW Size Cols: %d Lines: %d \n", NumCols, NumLines);
|
||||
LogError(LogStr);
|
||||
#endif
|
||||
HomeUp();
|
||||
TestSGR();
|
||||
DONE();
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
58
cde/programs/dtterm/tests/shared/Imakefile
Normal file
58
cde/programs/dtterm/tests/shared/Imakefile
Normal file
@@ -0,0 +1,58 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:48 drk $
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I$(TOP)/lib/
|
||||
LOCAL_LIBRARIES = $(SYNLIB) $(XEXT) $(XLIB)
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
XCOMMifdef HPArchitecture
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
#endif
|
||||
#if defined(HPOSFArchitecture)
|
||||
#endif
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
SRCS = synfunc.c \
|
||||
esclib.c \
|
||||
qalib.c
|
||||
|
||||
OBJS = synfunc.o \
|
||||
esclib.o \
|
||||
qalib.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
|
||||
|
||||
NormalLibraryTarget(termtest,$(OBJS))
|
||||
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
3
cde/programs/dtterm/tests/shared/README
Normal file
3
cde/programs/dtterm/tests/shared/README
Normal file
@@ -0,0 +1,3 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:29:27 drk $ */
|
||||
|
||||
|
||||
7
cde/programs/dtterm/tests/shared/common.h
Normal file
7
cde/programs/dtterm/tests/shared/common.h
Normal file
@@ -0,0 +1,7 @@
|
||||
/* $XConsortium: common.h /main/3 1995/10/31 11:59:55 rswiston $ */
|
||||
#define NULLCHAR '\0'
|
||||
#define BLANK ' '
|
||||
|
||||
typedef enum {
|
||||
DECModeSet=1, DECModeReset=2, DECModeSave=3, DECModeRestore=4
|
||||
} DECModeType;
|
||||
104
cde/programs/dtterm/tests/shared/escbase.h
Normal file
104
cde/programs/dtterm/tests/shared/escbase.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* $XConsortium: escbase.h /main/3 1995/10/31 12:00:08 rswiston $ */
|
||||
|
||||
/** ANSI Escape sequences */
|
||||
#define HOME_UP "\033[H"
|
||||
|
||||
#define ERASE_FROM_CUR "\033[J"
|
||||
#define ERASE_TO_CUR "\033[1J"
|
||||
#define ERASE_ALL "\033[2J"
|
||||
#define CLEAR_DISP ERASE_ALL
|
||||
#define ERASE_LN_FROM_CUR "\033[K"
|
||||
#define ERASE_LN_TO_CUR "\033[1K"
|
||||
#define ERASE_LN_ALL "\033[2K"
|
||||
#define ERASE_N_CHAR "\033[%dX"
|
||||
|
||||
#define CURSOR_UP "\033[A"
|
||||
#define CURSOR_N_UP "\033[%dA"
|
||||
#define CURSOR_DOWN "\033[B"
|
||||
#define CURSOR_N_DOWN "\033[%dB"
|
||||
#define CURSOR_N_FORW "\033[%dC"
|
||||
#define CURSOR_N_BACK "\033[%dD"
|
||||
#define GOTO_X_Y "\033[%d;%dH"
|
||||
#define GOTO_X_Y_HVP "\033[%d;%df"
|
||||
#define INDEX "\033D"
|
||||
#define REVERSEINDEX "\033M"
|
||||
#define NEXTLINE "\033E"
|
||||
#define CURSOR_N_PREV_LINE "\033[%dF"
|
||||
#define CURSOR_N_COLUMN "\033[%dG"
|
||||
|
||||
|
||||
#define INSERT_N_LINE "\033[%dL"
|
||||
#define INSERT_N_BLANK "\033[%d@"
|
||||
#define DELETE_N_LINE "\033[%dM"
|
||||
#define DELETE_N_CHAR "\033[%dP"
|
||||
|
||||
#define INSERT_MODE "\033[4h"
|
||||
#define REPLACE_MODE "\033[4l"
|
||||
|
||||
#define CUR_POSN_STAT "\033[6n"
|
||||
#define CUR_POSN_RPT "\033[%d;%dR"
|
||||
#define TERMINAL_STAT "\033[5n"
|
||||
#define TERMINAL_GOOD "\033[0n"
|
||||
#define TERMINAL_BAD "\033[3n"
|
||||
|
||||
#define CLEAR_CUR_TAB "\033[g"
|
||||
#define CLEAR_ALL_TABS "\033[3g"
|
||||
#define SET_TAB "\033H"
|
||||
|
||||
|
||||
#define SAVE_CURSOR "\0337"
|
||||
#define RESTORE_CURSOR "\0338"
|
||||
#define APPLN_KEYPAD "\033="
|
||||
#define NORMAL_KEYPAD "\033>"
|
||||
|
||||
|
||||
#define NORMAL "\033[0m"
|
||||
#define BOLD "\033[1m"
|
||||
#define UNDERSCORE "\033[4m"
|
||||
#define BLINK "\033[5m"
|
||||
#define INVERSE "\033[7m"
|
||||
|
||||
|
||||
#define SET_SCROLL_REGN "\033[%d;%dr"
|
||||
|
||||
/*** DEC Private Mode Set (DECSET) ***/
|
||||
|
||||
#define APPL_CUR_KEYS "\033[?1h"
|
||||
#define COLUMN_132 "\033[?3h"
|
||||
#define SMOOTH_SCROLL "\033[?4h"
|
||||
#define REVERSE_VIDEO "\033[?5h"
|
||||
#define ORIGIN_MODE "\033[?6h"
|
||||
#define WRAP_MODE "\033[?7h"
|
||||
#define MARGIN_BELL "\033[?44h"
|
||||
#define REVERSE_WRAP "\033[?45h"
|
||||
#define START_LOGGING "\033[?46h"
|
||||
|
||||
#define NORMAL_CUR_KEYS "\033[?1l"
|
||||
#define COLUMN_80 "\033[?3l"
|
||||
#define JUMP_SCROLL "\033[?4l"
|
||||
#define NORMAL_VIDEO "\033[?5l"
|
||||
#define CURSOR_MODE "\033[?6l"
|
||||
#define NO_WRAP_MODE "\033[?7l"
|
||||
#define NO_MARGIN_BELL "\033[?44l"
|
||||
#define NO_REVERSE_WRAP "\033[?45l"
|
||||
#define STOP_LOGGING "\033[?46l"
|
||||
|
||||
#define SAVE_CUR_KEYS "\033[?1s"
|
||||
#define SAVE_COLUMN_TYPE "\033[?3s"
|
||||
#define SAVE_SCROLL_TYPE "\033[?4s"
|
||||
#define SAVE_VIDEO_TYPE "\033[?5s"
|
||||
#define SAVE_SCREEN_MODE "\033[?6s"
|
||||
#define SAVE_WRAP_MODE "\033[?7s"
|
||||
#define SAVE_MARGIN_BELL_TYPE "\033[?44s"
|
||||
#define SAVE_REVERSE_WRAP_TYPE "\033[?45s"
|
||||
#define SAVE_LOGGING_TYPE "\033[?46s"
|
||||
|
||||
#define REST_CUR_KEYS "\033[?1r"
|
||||
#define REST_COLUMN_TYPE "\033[?3r"
|
||||
#define REST_SCROLL_TYPE "\033[?4r"
|
||||
#define REST_VIDEO_TYPE "\033[?5r"
|
||||
#define REST_SCREEN_MODE "\033[?6r"
|
||||
#define REST_WRAP_MODE "\033[?7r"
|
||||
#define REST_MARGIN_BELL_TYPE "\033[?44r"
|
||||
#define REST_REVERSE_WRAP_TYPE "\033[?45r"
|
||||
#define REST_LOGGING_TYPE "\033[?46r"
|
||||
459
cde/programs/dtterm/tests/shared/esclib.c
Normal file
459
cde/programs/dtterm/tests/shared/esclib.c
Normal file
@@ -0,0 +1,459 @@
|
||||
/* $XConsortium: esclib.c /main/3 1995/10/31 12:00:21 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "escbase.h"
|
||||
#include "common.h"
|
||||
|
||||
extern char *READTEST();
|
||||
|
||||
#define ESC_STR_LEN 20
|
||||
|
||||
void HomeUp()
|
||||
{
|
||||
WRITETEST(HOME_UP);
|
||||
}
|
||||
|
||||
void ClearScreen()
|
||||
{
|
||||
char Str[ESC_STR_LEN];
|
||||
sprintf(Str, "%s%s", HOME_UP, CLEAR_DISP);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void CursorUp(HowMuch)
|
||||
int HowMuch;
|
||||
{
|
||||
char Str[10];
|
||||
if (HowMuch == 0) return;
|
||||
sprintf(Str, CURSOR_N_UP, HowMuch);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void CursorDown(HowMuch)
|
||||
int HowMuch;
|
||||
{
|
||||
char Str[10];
|
||||
if (HowMuch == 0) return;
|
||||
sprintf(Str, CURSOR_N_DOWN, HowMuch);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void CursorForward(HowMuch)
|
||||
int HowMuch;
|
||||
{
|
||||
char Str[10];
|
||||
if (HowMuch == 0) return;
|
||||
sprintf(Str, CURSOR_N_FORW, HowMuch);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void CursorBack(HowMuch)
|
||||
int HowMuch;
|
||||
{
|
||||
char Str[10];
|
||||
if (HowMuch == 0) return;
|
||||
sprintf(Str, CURSOR_N_BACK, HowMuch);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void CursorPrevLine(HowMuch)
|
||||
int HowMuch;
|
||||
{
|
||||
char Str[10];
|
||||
if (HowMuch == 0) return;
|
||||
sprintf(Str, CURSOR_N_PREV_LINE, HowMuch);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void CursorColumn(HowMuch)
|
||||
int HowMuch;
|
||||
{
|
||||
char Str[10];
|
||||
if (HowMuch == 0) return;
|
||||
sprintf(Str, CURSOR_N_COLUMN, HowMuch);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void GetCursorPosn(X, Y)
|
||||
int *X, *Y;
|
||||
/* expected ESC sequence is of the form Esc[n1;n2R */
|
||||
{
|
||||
char *Ptr, Line[5], Col[5];
|
||||
int i, j;
|
||||
WRITETEST(CUR_POSN_STAT);
|
||||
Ptr = READTEST("R");
|
||||
i = 2; j = 0;
|
||||
while (Ptr[i] != ';') {Line[j] = Ptr[i]; i++; j++;}
|
||||
Line[j++] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while (Ptr[i] != 'R') {Col[j] = Ptr[i]; i++; j++;}
|
||||
Col[j++] = NULLCHAR;
|
||||
*Y = atoi(Line); *X = atoi(Col);
|
||||
}
|
||||
|
||||
int CheckTermStatus()
|
||||
/* return 1 if term is in proper status else 0 */
|
||||
{
|
||||
char *Ptr;
|
||||
WRITETEST(TERMINAL_STAT);
|
||||
Ptr = READTEST("n");
|
||||
if (strcmp(Ptr, TERMINAL_GOOD) == 0) return(0);
|
||||
else return(-1);
|
||||
}
|
||||
|
||||
void AbsoluteGoToXY(X, Y)
|
||||
int X, Y;
|
||||
{
|
||||
char Str[ESC_STR_LEN];
|
||||
sprintf(Str, GOTO_X_Y, Y, X);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void AbsoluteGoToXY_HVP(X, Y)
|
||||
int X, Y;
|
||||
{
|
||||
char Str[ESC_STR_LEN];
|
||||
sprintf(Str, GOTO_X_Y_HVP, Y, X);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void RelativeGoToXY(CurrX, CurrY, X, Y)
|
||||
int CurrX, CurrY, X, Y;
|
||||
{
|
||||
if (X < CurrX) CursorBack((CurrX - X));
|
||||
else CursorForward((X - CurrX));
|
||||
if (Y < CurrY) CursorUp((CurrY - Y));
|
||||
else CursorDown((Y - CurrY));
|
||||
}
|
||||
|
||||
void Index()
|
||||
{
|
||||
WRITETEST(INDEX);
|
||||
}
|
||||
|
||||
|
||||
void ReverseIndex()
|
||||
{
|
||||
WRITETEST(REVERSEINDEX);
|
||||
}
|
||||
|
||||
|
||||
void NextLine()
|
||||
{
|
||||
WRITETEST(NEXTLINE);
|
||||
}
|
||||
|
||||
void InsertLines(Howmany)
|
||||
int Howmany;
|
||||
{
|
||||
char Str[10];
|
||||
if (Howmany == 0) return;
|
||||
sprintf(Str, INSERT_N_LINE, Howmany);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void InsertBlanks(Howmany)
|
||||
int Howmany;
|
||||
{
|
||||
char Str[10];
|
||||
if (Howmany == 0) return;
|
||||
sprintf(Str, INSERT_N_BLANK, Howmany);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void DeleteLines(Howmany)
|
||||
int Howmany;
|
||||
{
|
||||
char Str[10];
|
||||
if (Howmany == 0) return;
|
||||
sprintf(Str, DELETE_N_LINE, Howmany);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
|
||||
void DeleteChars(Howmany)
|
||||
int Howmany;
|
||||
{
|
||||
char Str[10];
|
||||
if (Howmany == 0) return;
|
||||
sprintf(Str, DELETE_N_CHAR, Howmany);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void SetInsertMode()
|
||||
{
|
||||
WRITETEST(INSERT_MODE);
|
||||
}
|
||||
|
||||
|
||||
void SetReplaceMode()
|
||||
{
|
||||
WRITETEST(REPLACE_MODE);
|
||||
}
|
||||
|
||||
void GetWinSize(Lines, Cols)
|
||||
int *Lines, *Cols;
|
||||
{
|
||||
AbsoluteGoToXY(999, 999);
|
||||
GetCursorPosn(Cols, Lines);
|
||||
}
|
||||
|
||||
/*** TabFunctions ***/
|
||||
|
||||
void ClearAllTabs()
|
||||
{
|
||||
WRITETEST(CLEAR_ALL_TABS);
|
||||
}
|
||||
|
||||
void ClearCurTab()
|
||||
{
|
||||
WRITETEST(CLEAR_CUR_TAB);
|
||||
}
|
||||
|
||||
void SetTab()
|
||||
{
|
||||
WRITETEST(SET_TAB);
|
||||
}
|
||||
|
||||
|
||||
void EraseLnFromCur()
|
||||
{
|
||||
WRITETEST(ERASE_LN_FROM_CUR);
|
||||
}
|
||||
|
||||
|
||||
void EraseLnToCur()
|
||||
{
|
||||
WRITETEST(ERASE_LN_TO_CUR);
|
||||
}
|
||||
|
||||
void EraseLnAll()
|
||||
{
|
||||
WRITETEST(ERASE_LN_ALL);
|
||||
}
|
||||
|
||||
|
||||
void EraseScrFromCur()
|
||||
{
|
||||
WRITETEST(ERASE_FROM_CUR);
|
||||
}
|
||||
|
||||
|
||||
void EraseScrToCur()
|
||||
{
|
||||
WRITETEST(ERASE_TO_CUR);
|
||||
}
|
||||
|
||||
void EraseScrAll()
|
||||
{
|
||||
WRITETEST(ERASE_ALL);
|
||||
}
|
||||
|
||||
void EraseChars(Howmany)
|
||||
int Howmany;
|
||||
{
|
||||
char Str[10];
|
||||
if (Howmany == 0) return;
|
||||
sprintf(Str, ERASE_N_CHAR, Howmany);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
|
||||
void SetApplnKeyPad()
|
||||
{
|
||||
WRITETEST(APPLN_KEYPAD);
|
||||
}
|
||||
|
||||
void SetNormalKeyPad()
|
||||
{
|
||||
WRITETEST(NORMAL_KEYPAD);
|
||||
}
|
||||
|
||||
void SetDispNormal()
|
||||
{
|
||||
WRITETEST(NORMAL);
|
||||
}
|
||||
|
||||
void SetDispBold()
|
||||
{
|
||||
WRITETEST(BOLD);
|
||||
}
|
||||
|
||||
void SetDispUnderscore()
|
||||
{
|
||||
WRITETEST(UNDERSCORE);
|
||||
}
|
||||
|
||||
void SetDispBlink()
|
||||
{
|
||||
WRITETEST(BLINK);
|
||||
}
|
||||
|
||||
void SetDispInverse()
|
||||
{
|
||||
WRITETEST(INVERSE);
|
||||
}
|
||||
|
||||
void SaveCursor()
|
||||
{
|
||||
WRITETEST(SAVE_CURSOR);
|
||||
}
|
||||
|
||||
|
||||
void RestoreCursor()
|
||||
{
|
||||
WRITETEST(RESTORE_CURSOR);
|
||||
}
|
||||
|
||||
void SetScrollRegn(Top, Bottom)
|
||||
int Top, Bottom;
|
||||
{
|
||||
char Str[ESC_STR_LEN];
|
||||
sprintf(Str, SET_SCROLL_REGN, Top, Bottom);
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
|
||||
void SetCursorKeys(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(APPL_CUR_KEYS); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(NORMAL_CUR_KEYS); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_CUR_KEYS); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_CUR_KEYS); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetColumnWidth(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(COLUMN_80); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(COLUMN_132); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_COLUMN_TYPE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_COLUMN_TYPE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetScrollType(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(SMOOTH_SCROLL); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(JUMP_SCROLL); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_SCROLL_TYPE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_SCROLL_TYPE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetVideoType(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(REVERSE_VIDEO); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(NORMAL_VIDEO); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_VIDEO_TYPE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_VIDEO_TYPE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetOriginMode(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(ORIGIN_MODE); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(CURSOR_MODE); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_SCREEN_MODE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_SCREEN_MODE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetWrapMode(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(WRAP_MODE); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(NO_WRAP_MODE); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_WRAP_MODE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_WRAP_MODE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetMarginBell(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(MARGIN_BELL); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(NO_MARGIN_BELL); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_MARGIN_BELL_TYPE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_MARGIN_BELL_TYPE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetReverseWrap(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(REVERSE_WRAP); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(NO_REVERSE_WRAP); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_REVERSE_WRAP_TYPE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_REVERSE_WRAP_TYPE); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetLoggingMode(DECMode)
|
||||
DECModeType DECMode;
|
||||
{
|
||||
switch(DECMode) {
|
||||
case DECModeSet:
|
||||
WRITETEST(START_LOGGING); break;
|
||||
case DECModeReset:
|
||||
WRITETEST(STOP_LOGGING); break;
|
||||
case DECModeSave:
|
||||
WRITETEST(SAVE_LOGGING_TYPE); break;
|
||||
case DECModeRestore:
|
||||
WRITETEST(REST_LOGGING_TYPE); break;
|
||||
}
|
||||
}
|
||||
|
||||
#define BACKSPACE 010
|
||||
|
||||
void BackSpace(HowMany)
|
||||
int HowMany;
|
||||
{
|
||||
int i; char Str[20];
|
||||
for (i=0; i < HowMany-1; i++)
|
||||
{sprintf(Str, "%c", BACKSPACE); WRITETEST(Str);}
|
||||
}
|
||||
24
cde/programs/dtterm/tests/shared/include_files.h
Normal file
24
cde/programs/dtterm/tests/shared/include_files.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: include_files.h /main/3 1995/10/31 12:00:37 rswiston $ */
|
||||
#ifndef DO_NOT_NEED_NOW
|
||||
#define DO_NOT_NEED_NOW
|
||||
#endif
|
||||
|
||||
#ifndef _HPUX_SOURCE
|
||||
#define _HPUX_SOURCE
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
#ifdef sun
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include "p2c.h"
|
||||
|
||||
397
cde/programs/dtterm/tests/shared/p2c.h
Normal file
397
cde/programs/dtterm/tests/shared/p2c.h
Normal file
@@ -0,0 +1,397 @@
|
||||
/* $XConsortium: p2c.h /main/3 1995/10/31 12:00:53 rswiston $ */
|
||||
#ifndef P2C_H
|
||||
#define P2C_H
|
||||
|
||||
|
||||
/* Header file for code generated by "p2c", the Pascal-to-C translator */
|
||||
|
||||
/* "p2c" Copyright (C) 1989 Dave Gillespie, version 1.14.
|
||||
* This file may be copied, modified, etc. in any way. It is not restricted
|
||||
* by the licence agreement accompanying p2c itself.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/* If the following heuristic fails, compile -DBSD=0 for non-BSD systems,
|
||||
or -DBSD=1 for BSD systems. */
|
||||
|
||||
#ifdef M_XENIX
|
||||
# define BSD 0
|
||||
#endif
|
||||
|
||||
#ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */
|
||||
# ifndef BSD /* (a convenient, but horrible kludge!) */
|
||||
# define BSD 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
# if !BSD
|
||||
# undef BSD
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
# define HAS_STDLIB
|
||||
# define __CAT__(a,b)a##b
|
||||
#else
|
||||
# ifndef BSD
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <sys/types.h>
|
||||
# define __ID__(a)a
|
||||
# define __CAT__(a,b)__ID__(a)b
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BSD
|
||||
# include <strings.h>
|
||||
# define memcpy(a,b,n) (bcopy(b,a,n),a)
|
||||
# define memcmp(a,b,n) bcmp(a,b,n)
|
||||
# define strchr(s,c) index(s,c)
|
||||
# define strrchr(s,c) rindex(s,c)
|
||||
#else
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <setjmp.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
typedef struct __p2c_jmp_buf {
|
||||
struct __p2c_jmp_buf *next;
|
||||
jmp_buf jbuf;
|
||||
} __p2c_jmp_buf;
|
||||
|
||||
|
||||
/* Warning: The following will not work if setjmp is used simultaneously.
|
||||
This also violates the ANSI restriction about using vars after longjmp,
|
||||
but a typical implementation of longjmp will get it right anyway. */
|
||||
|
||||
#ifndef FAKE_TRY
|
||||
# define TRY(x) do { __p2c_jmp_buf __try_jb; \
|
||||
__try_jb.next = __top_jb; \
|
||||
if (!setjmp((__top_jb = &__try_jb)->jbuf)) {
|
||||
# define RECOVER(x) __top_jb = __try_jb.next; } else {
|
||||
# define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \
|
||||
if (0) { L: __top_jb = __try_jb.next; }
|
||||
# define ENDTRY(x) } } while (0)
|
||||
#else
|
||||
# define TRY(x) if (1) {
|
||||
# define RECOVER(x) } else do {
|
||||
# define RECOVER2(x,L) } else do { L: ;
|
||||
# define ENDTRY(x) } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef M_XENIX /* avoid compiler bug */
|
||||
# define SHORT_MAX (32767)
|
||||
# define SHORT_MIN (-32768)
|
||||
#endif
|
||||
|
||||
|
||||
/* The following definitions work only on twos-complement machines */
|
||||
#ifndef SHORT_MAX
|
||||
# define SHORT_MAX (((unsigned short) -1) >> 1)
|
||||
# define SHORT_MIN (~SHORT_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef INT_MAX
|
||||
# define INT_MAX (((unsigned int) -1) >> 1)
|
||||
# define INT_MIN (~INT_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX (((unsigned long) -1) >> 1)
|
||||
# define LONG_MIN (~LONG_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0
|
||||
# define SEEK_CUR 1
|
||||
# define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 0
|
||||
# define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
|
||||
#define SETBITS 32
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
# define Signed signed
|
||||
# define Void void /* Void f() = procedure */
|
||||
# ifndef Const
|
||||
# define Const const
|
||||
# endif
|
||||
# ifndef Volatile
|
||||
# define Volatile volatile
|
||||
# endif
|
||||
# define PP(x) x /* function prototype */
|
||||
# define PV() (void) /* null function prototype */
|
||||
typedef void *Anyptr;
|
||||
#else
|
||||
# define Signed
|
||||
# define Void void
|
||||
# ifndef Const
|
||||
# define Const
|
||||
# endif
|
||||
# ifndef Volatile
|
||||
# define Volatile
|
||||
# endif
|
||||
# define PP(x) ()
|
||||
# define PV() ()
|
||||
typedef char *Anyptr;
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define Inline inline
|
||||
#else
|
||||
# define Inline
|
||||
#endif
|
||||
|
||||
#define Register register /* Register variables */
|
||||
#define Char char /* Characters (not bytes) */
|
||||
|
||||
#ifndef Static
|
||||
# define Static static /* Private global funcs and vars */
|
||||
#endif
|
||||
|
||||
#ifndef Local
|
||||
# define Local static /* Nested functions */
|
||||
#endif
|
||||
|
||||
typedef Signed char schar;
|
||||
#ifndef _AIX
|
||||
typedef unsigned char uchar;
|
||||
#endif /* _AIX */
|
||||
typedef unsigned char boolean;
|
||||
|
||||
#ifndef true
|
||||
# define true 1
|
||||
# define false 0
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
Anyptr proc, link;
|
||||
} _PROCEDURE;
|
||||
|
||||
#ifndef _FNSIZE
|
||||
# define _FNSIZE 120
|
||||
#endif
|
||||
|
||||
/* Most of the following vars were "Unsatisfied symbols at load time
|
||||
extern Void PASCAL_MAIN PP( (int, Char **) );
|
||||
extern Char **P_argv;
|
||||
extern int P_argc;
|
||||
extern short P_escapecode;
|
||||
extern int P_ioresult;
|
||||
extern __p2c_jmp_buf *__top_jb;
|
||||
*/
|
||||
|
||||
#ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */
|
||||
extern Char *strcat PP( (Char *, Const Char *) );
|
||||
extern Char *strchr PP( (Const Char *, int) );
|
||||
extern int strcmp PP( (Const Char *, Const Char *) );
|
||||
extern Char *strcpy PP( (Char *, Const Char *) );
|
||||
extern size_t strlen PP( (Const Char *) );
|
||||
extern Char *strncat PP( (Char *, Const Char *, size_t) );
|
||||
extern int strncmp PP( (Const Char *, Const Char *, size_t) );
|
||||
extern Char *strncpy PP( (Char *, Const Char *, size_t) );
|
||||
extern Char *strrchr PP( (Const Char *, int) );
|
||||
|
||||
extern Anyptr memchr PP( (Const Anyptr, int, size_t) );
|
||||
extern Anyptr memmove PP( (Anyptr, Const Anyptr, size_t) );
|
||||
extern Anyptr memset PP( (Anyptr, int, size_t) );
|
||||
#ifndef memcpy
|
||||
extern Anyptr memcpy PP( (Anyptr, Const Anyptr, size_t) );
|
||||
extern int memcmp PP( (Const Anyptr, Const Anyptr, size_t) );
|
||||
#endif
|
||||
|
||||
extern int atoi PP( (Const Char *) );
|
||||
extern double atof PP( (Const Char *) );
|
||||
extern long atol PP( (Const Char *) );
|
||||
extern double strtod PP( (Const Char *, Char **) );
|
||||
extern long strtol PP( (Const Char *, Char **, int) );
|
||||
#endif /*P2C_H_PROTO*/
|
||||
|
||||
#ifndef HAS_STDLIB
|
||||
#ifndef _AIX
|
||||
extern Anyptr malloc PP( (size_t) );
|
||||
#endif /* _AIX */
|
||||
extern Void free PP( (Anyptr) );
|
||||
#endif /* HAS_STDLIB */
|
||||
|
||||
extern int _OutMem PV();
|
||||
extern int _CaseCheck PV();
|
||||
extern int _NilCheck PV();
|
||||
extern int _Escape PP( (int) );
|
||||
extern int _EscIO PP( (int) );
|
||||
|
||||
extern long ipow PP( (long, long) );
|
||||
/* strsub defined in qalib.c */
|
||||
/* extern Char *strsub PP( (Char *, Char *, int, int) ); */
|
||||
extern Char *strltrim PP( (Char *) );
|
||||
extern Char *strrtrim PP( (Char *) );
|
||||
extern Char *strrpt PP( (Char *, Char *, int) );
|
||||
extern Char *strpad PP( (Char *, Char *, int, int) );
|
||||
|
||||
/* strpos2 defined in qalib.c */
|
||||
/* extern int strpos2 PP( (Char *, Char *, int) ); */
|
||||
extern long memavail PV();
|
||||
extern int P_peek PP( (FILE *) );
|
||||
extern int P_eof PP( (FILE *) );
|
||||
extern int P_eoln PP( (FILE *) );
|
||||
extern Void P_readpaoc PP( (FILE *, Char *, int) );
|
||||
extern Void P_readlnpaoc PP( (FILE *, Char *, int) );
|
||||
extern long P_maxpos PP( (FILE *) );
|
||||
extern long *P_setunion PP( (long *, long *, long *) );
|
||||
extern long *P_setint PP( (long *, long *, long *) );
|
||||
extern long *P_setdiff PP( (long *, long *, long *) );
|
||||
extern long *P_setxor PP( (long *, long *, long *) );
|
||||
extern int P_inset PP( (unsigned, long *) );
|
||||
extern int P_setequal PP( (long *, long *) );
|
||||
extern int P_subset PP( (long *, long *) );
|
||||
extern long *P_addset PP( (long *, unsigned) );
|
||||
extern long *P_addsetr PP( (long *, unsigned, unsigned) );
|
||||
extern long *P_remset PP( (long *, unsigned) );
|
||||
extern long *P_setcpy PP( (long *, long *) );
|
||||
extern long *P_expset PP( (long *, long) );
|
||||
extern long P_packset PP( (long *) );
|
||||
extern int P_getcmdline PP( (int l, int h, Char *line) );
|
||||
extern Void TimeStamp PP( (int *Day, int *Month, int *Year,
|
||||
int *Hour, int *Min, int *Sec) );
|
||||
extern Void P_sun_argv PP( (char *, int, int) );
|
||||
|
||||
|
||||
/* I/O error handling */
|
||||
#define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \
|
||||
: P_ioresult=(ior),(def))
|
||||
#define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior))
|
||||
|
||||
/* Following defines are suitable for the HP Pascal operating system */
|
||||
#define FileNotFound 10
|
||||
#define FileNotOpen 13
|
||||
#define FileWriteError 38
|
||||
#define BadInputFormat 14
|
||||
#define EndOfFile 30
|
||||
|
||||
/* Creating temporary files */
|
||||
#if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE)
|
||||
# define tmpfile() (fopen(tmpnam(NULL), "w+"))
|
||||
#endif
|
||||
|
||||
/* File buffers */
|
||||
#define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \
|
||||
sc type __CAT__(f,_BUFFER)
|
||||
|
||||
#define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1)
|
||||
#define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0)
|
||||
|
||||
#define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \
|
||||
((__CAT__(f,_BFLAGS) = 2), \
|
||||
fread(&__CAT__(f,_BUFFER), \
|
||||
sizeof(type),1,(f)))),\
|
||||
&__CAT__(f,_BUFFER)))
|
||||
#define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \
|
||||
((__CAT__(f,_BFLAGS) = 2), \
|
||||
fread(&__CAT__(f,_BUFFER), \
|
||||
sizeof(type),1,(f)))),\
|
||||
__CAT__(f,_BUFFER))
|
||||
|
||||
#define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v))
|
||||
#define CPUTFBUF(f,v) (PUTFBUF(f,char,v))
|
||||
#define APUTFBUF(f,type,v) (memcpy(GETFBUF(f,type), (v), \
|
||||
sizeof(__CAT__(f,_BUFFER))))
|
||||
|
||||
#define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \
|
||||
fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \
|
||||
(__CAT__(f,_BFLAGS) = 1))
|
||||
|
||||
#define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \
|
||||
(__CAT__(f,_BFLAGS) = 0))
|
||||
#define CPUT(f) (PUT(f,char))
|
||||
|
||||
/* Memory allocation */
|
||||
#ifdef __GCC__
|
||||
# define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem())
|
||||
#else
|
||||
extern Anyptr __MallocTemp__;
|
||||
# define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem())
|
||||
#endif
|
||||
#define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */
|
||||
#define Free(p) (free((Anyptr)(p)), (p)=NULL)
|
||||
|
||||
/* sign extension */
|
||||
#define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1))
|
||||
|
||||
/* packed arrays */ /* BEWARE: these are untested! */
|
||||
#define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \
|
||||
(((~(i))&((1<<(L)-(n))-1)) << (n)) & \
|
||||
(1<<(1<<(n)))-1))
|
||||
|
||||
#define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \
|
||||
(16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\
|
||||
(n)) >> (16-(1<<(n))))))
|
||||
|
||||
#define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \
|
||||
(x) << (((~(i))&((1<<(L)-(n))-1)) << (n)))
|
||||
|
||||
#define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \
|
||||
((x) & (1<<(1<<(n)))-1) << \
|
||||
(((~(i))&((1<<(L)-(n))-1)) << (n)))
|
||||
|
||||
#define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \
|
||||
~( ((1<<(1<<(n)))-1) << \
|
||||
(((~(i))&((1<<(L)-(n))-1)) << (n))) )
|
||||
|
||||
/* small packed arrays */
|
||||
#define P_getbits_US(v,i,n) ((int)((v) >> (~(i) << (n)) & (1<<(1<<(n)))-1))
|
||||
#define P_getbits_SS(v,i,n) ((int)((long)(v) << (32 - (((~(i))+1) << (n))) >> (32-(1<<(n)))))
|
||||
#define P_putbits_US(v,i,x,n) ((v) |= (x) << (~(i) << (n)))
|
||||
#define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << (~(i) << (n)))
|
||||
#define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << (~(i) << (n)) ))
|
||||
|
||||
#define P_max(a,b) ((a) > (b) ? (a) : (b))
|
||||
#define P_min(a,b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
|
||||
/* Fix toupper/tolower on Suns and other stupid BSD systems */
|
||||
#ifdef toupper
|
||||
# undef toupper
|
||||
# undef tolower
|
||||
# define toupper(c) my_toupper(c)
|
||||
# define tolower(c) my_tolower(c)
|
||||
#endif
|
||||
|
||||
#ifndef _toupper
|
||||
# if 'A' == 65 && 'a' == 97
|
||||
# define _toupper(c) ((c)-'a'+'A')
|
||||
# define _tolower(c) ((c)-'A'+'a')
|
||||
# else
|
||||
# define _toupper(c) toupper(c)
|
||||
# define _tolower(c) tolower(c)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* P2C_H */
|
||||
|
||||
|
||||
|
||||
/* End. */
|
||||
|
||||
|
||||
1518
cde/programs/dtterm/tests/shared/qalib.c
Normal file
1518
cde/programs/dtterm/tests/shared/qalib.c
Normal file
File diff suppressed because it is too large
Load Diff
324
cde/programs/dtterm/tests/shared/synfunc.c
Normal file
324
cde/programs/dtterm/tests/shared/synfunc.c
Normal file
@@ -0,0 +1,324 @@
|
||||
/* $XConsortium: synfunc.c /main/3 1995/10/31 12:01:30 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include "synvar.h"
|
||||
|
||||
|
||||
int errno;
|
||||
|
||||
|
||||
|
||||
#ifdef LOG
|
||||
extern FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
static TestData test;
|
||||
extern char LogStr[200];
|
||||
|
||||
void LogTime()
|
||||
{
|
||||
time_t Time;
|
||||
#ifdef LOG
|
||||
time(&Time);
|
||||
fprintf(TermLog, "%s", ctime(&Time));
|
||||
SAVELOG;
|
||||
#endif
|
||||
}
|
||||
|
||||
void LogError(Str)
|
||||
char *Str;
|
||||
{
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "%s\n", Str);
|
||||
SAVELOG;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
char *MemAllocate(Size)
|
||||
int Size;
|
||||
{
|
||||
char *P;
|
||||
if (Size <= 0) {
|
||||
sprintf(LogStr, "Invalid Size for memory allocation %d ", Size);
|
||||
LogError(LogStr); return(NULL);
|
||||
}
|
||||
P = (char *) calloc(Size, 1);
|
||||
if (P == NULL) {
|
||||
sprintf(LogStr, "No memory for allocation");
|
||||
LogError(LogStr); return(NULL);
|
||||
}
|
||||
return(P);
|
||||
}
|
||||
|
||||
void MemRelease(P)
|
||||
char *P;
|
||||
{
|
||||
if (P == NULL) {LogError("Invalid memory address for release");return;}
|
||||
free(P);
|
||||
}
|
||||
|
||||
int FileExists(FileName)
|
||||
char *FileName;
|
||||
{
|
||||
if (fopen(FileName, "r") != NULL) return(0);
|
||||
return((int) errno);
|
||||
}
|
||||
|
||||
|
||||
void InitTest(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
test.display = SynOpenDisplay(NULL);
|
||||
SynParseCommandOptions(argc, argv);
|
||||
SynNameWindow(test.display, DefaultRootWindow(test.display), "WinRoot");
|
||||
#if 0
|
||||
SynSetDoubleClickDelay(MULTI_CLICK_DELAY);
|
||||
#endif
|
||||
test.waitTime = WIN_WAIT_TIME;
|
||||
}
|
||||
|
||||
CloseTest(exitDialog)
|
||||
int exitDialog;
|
||||
{
|
||||
Window Win;
|
||||
SynStatus Result;
|
||||
SynCloseDisplay(test.display);
|
||||
}
|
||||
|
||||
void MatchWindows(WinName, ImageFile)
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
int Result;
|
||||
SynStatus SynResult;
|
||||
char *Expected, *Actual;
|
||||
|
||||
#ifdef SLOW
|
||||
sleep(10);
|
||||
#endif
|
||||
if ((Result = FileExists(ImageFile)) != 0) {
|
||||
sprintf(LogStr, "ImageFile <%s> does not exist", ImageFile);
|
||||
#if 0
|
||||
if (Result == ENOENT)
|
||||
sprintf(LogStr, "ImageFile <%s> does not exist", ImageFile);
|
||||
else if (Result == EACCES)
|
||||
sprintf(LogStr, "ImageFile <%s> permission problem ", ImageFile);
|
||||
else LogError(LogStr, "ImageFile <%s> Unknown error ", ImageFile);
|
||||
#endif
|
||||
LogError(LogStr);
|
||||
}
|
||||
Expected = MemAllocate((int) (strlen(ImageFile) + strlen(EXPECTED_SUFFIX)));
|
||||
Actual = MemAllocate((int) (strlen(ImageFile) + strlen(ACTUAL_SUFFIX)));
|
||||
strcpy(Expected, ImageFile); strcat(Expected, EXPECTED_SUFFIX);
|
||||
strcpy(Actual, ImageFile); strcat(Actual, ACTUAL_SUFFIX);
|
||||
if ((SynResult = SynCompareWindowImage(test.display, WinName, ImageFile,
|
||||
Expected, Actual)) != SYN_SUCCESS) {
|
||||
sprintf(LogStr,"ImageComparison Failed ImageFile <%s> \
|
||||
Expected <%s> Actual <%s>", ImageFile, Expected, Actual);
|
||||
LogError(LogStr);
|
||||
}
|
||||
else {
|
||||
sprintf(LogStr, "ImageComparison Success \n");
|
||||
LogError(LogStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int AssignWinName(WinName, TitleName)
|
||||
char *WinName, *TitleName;
|
||||
{
|
||||
SynStatus Result;
|
||||
Window Win, *SelList;
|
||||
int SelCount;
|
||||
Result = SynNameWindowByProperty(test.display, WinName, TitleName,
|
||||
"WM_CLASS", &SelList, &SelCount);
|
||||
if (Result == SYN_SUCCESS)
|
||||
{sprintf(LogStr, "SynSucc SelCount %d ", SelCount); LogError(LogStr);}
|
||||
else if (Result == SYN_NAME_COLLISION)
|
||||
{sprintf(LogStr, "Window Collision "); LogError(LogStr);}
|
||||
else if (Result == BAD_SYN_WINDOW)
|
||||
{sprintf(LogStr, "SynFail"); LogError(LogStr); return(-1);}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
void PressKeypadKeys()
|
||||
{
|
||||
SynClickKey(test.display, "<KP_0>");
|
||||
SynClickKey(test.display, "<KP_1>");
|
||||
SynClickKey(test.display, "<KP_2>");
|
||||
SynClickKey(test.display, "<KP_3>");
|
||||
SynClickKey(test.display, "<KP_4>");
|
||||
SynClickKey(test.display, "<KP_5>");
|
||||
SynClickKey(test.display, "<KP_6>");
|
||||
SynClickKey(test.display, "<KP_7>");
|
||||
SynClickKey(test.display, "<KP_8>");
|
||||
SynClickKey(test.display, "<KP_9>");
|
||||
SynClickKey(test.display, "<KP_Multiply>");
|
||||
SynClickKey(test.display, "<KP_Divide>");
|
||||
SynClickKey(test.display, "<KP_Add>");
|
||||
SynClickKey(test.display, "<KP_Subtract>");
|
||||
SynClickKey(test.display, "<KP_Separator>");
|
||||
SynClickKey(test.display, "<KP_Tab>");
|
||||
SynClickKey(test.display, "<KP_Decimal>");
|
||||
SynClickKey(test.display, "<KP_Enter>");
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void PrintTermString(WinName, String)
|
||||
char *WinName, *String;
|
||||
{
|
||||
int i;
|
||||
SynMovePointer(test.display, WinName, "LocTerm1");
|
||||
for (i=0; i < 5; i++) {
|
||||
SynPrintString(test.display, String);
|
||||
SynPrintString(test.display, " ");
|
||||
}
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void ExecCommand(Command)
|
||||
char *Command;
|
||||
{
|
||||
sleep(5);
|
||||
SynMovePointer(test.display, "WinRoot", "LocTerm");
|
||||
SynPressAndHoldKey(test.display, "<Control_L>");
|
||||
SynPrintString(test.display, "C");
|
||||
SynReleaseKey(test.display, "<Control_L>");
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
/* Above things are auxillary things and assumes intr set as ^C */
|
||||
SynPrintString(test.display, Command);
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void ExecWinCommand(WinName, Command)
|
||||
char *WinName, *Command;
|
||||
{
|
||||
SynMovePointer(test.display, WinName, "LocTerm1");
|
||||
SynPressAndHoldKey(test.display, "<Control_L>");
|
||||
SynPrintString(test.display, "C");
|
||||
SynReleaseKey(test.display, "<Control_L>");
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
/* Above things are auxillary things and assumes intr set as ^C */
|
||||
SynPrintString(test.display, Command);
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void PressPrevKey(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynClickKey(test.display, "<Prior>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void PressCtrlGKey(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynPressAndHoldKey(test.display, "<Control_L>");
|
||||
SynPrintString(test.display, "G");
|
||||
SynReleaseKey(test.display, "<Control_L>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void PressKeyNtimes(WinName, Key, N)
|
||||
char *WinName, *Key;
|
||||
int N;
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < N; i++)
|
||||
SynPrintString(test.display, Key);
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void PressBackSpace(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynClickKey(test.display, "<BackSpace>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void CloseTerm(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynMovePointer(test.display, WinName, "LocTerm1");
|
||||
SynPressAndHoldKey(test.display, "<Control_L>");
|
||||
SynPrintString(test.display, "C");
|
||||
SynReleaseKey(test.display, "<Control_L>");
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
SynPrintString(test.display, "exit");
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
void JustExit(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynMovePointer(test.display, WinName, "LocTerm1");
|
||||
SynPrintString(test.display, "exit");
|
||||
SynClickKey(test.display, "<Return>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
|
||||
int WaitWinMap(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynStatus Result;
|
||||
Result = SynWaitWindowMap(test.display, WinName, WIN_WAIT_TIME);
|
||||
if (Result == SYN_TIME_OUT)
|
||||
{LogError("term window did not come up"); return(-1);}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void WaitWinUnMap(WinName, WaitTime)
|
||||
char *WinName;
|
||||
long WaitTime;
|
||||
{
|
||||
SynStatus Result;
|
||||
Result = SynWaitWindowUnmap(test.display, WinName, WaitTime);
|
||||
if (Result == BAD_SYN_WINDOW) LogError("Named window does not exist");
|
||||
}
|
||||
|
||||
void CheckCapsLock()
|
||||
{
|
||||
int X, Y, X1, Y1;
|
||||
unsigned int Mask;
|
||||
Window A, B;
|
||||
if (XQueryPointer(test.display, DefaultRootWindow((test.display)),
|
||||
&A, &B, &X, &Y, &X1, &Y1, &Mask) == True) {
|
||||
if ((Mask&LockMask) == LockMask) {
|
||||
SynClickKey(test.display, "<Caps_Lock>");
|
||||
SynFlushInputBuffer(test.display);
|
||||
}
|
||||
}
|
||||
else LogError("QueryPointer failed ");
|
||||
}
|
||||
|
||||
void Deiconify(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynDoubleClickButton(test.display, "Button1", WinName, "LocTerm1");
|
||||
SynWaitWindowMap(test.display, NULL, WIN_WAIT_TIME);
|
||||
SynWaitWindowUnmap(test.display, NULL,WIN_WAIT_TIME);
|
||||
SynWaitWindowUnmap(test.display, WinName, WIN_WAIT_TIME);
|
||||
}
|
||||
|
||||
void TestMenu(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
SynMovePointer(test.display, WinName, "file");
|
||||
SynClickButton(test.display, "Button1", WinName, "file");
|
||||
SynMovePointer(test.display, WinName, "file");
|
||||
/*
|
||||
SynClickButton(test.display, "Button1", WinName, "exit");
|
||||
*/
|
||||
sleep(5);
|
||||
}
|
||||
32
cde/programs/dtterm/tests/shared/synvar.h
Normal file
32
cde/programs/dtterm/tests/shared/synvar.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: synvar.h /main/3 1995/10/31 12:01:44 rswiston $ */
|
||||
|
||||
/******************************************************************
|
||||
*
|
||||
* (c) Copyright Hewlett-Packard Company, 1993.
|
||||
*
|
||||
******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <synlib/synlib.h>
|
||||
|
||||
typedef struct {
|
||||
Display *display;
|
||||
int waitTime;
|
||||
SynFocus *focusMap;
|
||||
} TestData, *TestDataPtr;
|
||||
|
||||
|
||||
#define WIN_WAIT_TIME 120
|
||||
#define MULTI_CLICK_DELAY 5
|
||||
|
||||
#define IMAGE_DIR "../image/"
|
||||
#define EXPECTED_SUFFIX ".exp"
|
||||
#define ACTUAL_SUFFIX ".act"
|
||||
|
||||
#define NEED_LEN 256
|
||||
|
||||
#define IMAGE_FILE_LEN 100 /* should be strlen(IMAGE_DIR) + 20 (say) */
|
||||
|
||||
|
||||
#define TERM_EMU "dtterm"
|
||||
58
cde/programs/dtterm/tests/tabctrl/Imakefile
Normal file
58
cde/programs/dtterm/tests/tabctrl/Imakefile
Normal file
@@ -0,0 +1,58 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:56 drk $
|
||||
PROGRAMS = tabctrl
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#ifdef HPArchitecture
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
#endif
|
||||
#if defined(HPOSFArchitecture)
|
||||
#endif
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = tabctrl.c
|
||||
|
||||
OBJS = tabctrl.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
cde/programs/dtterm/tests/tabctrl/README
Normal file
21
cde/programs/dtterm/tests/tabctrl/README
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:29:56 drk $ */
|
||||
TestName: tabctrl
|
||||
|
||||
Description: This program tests the tab functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[g"
|
||||
"\033[3g"
|
||||
"\033H"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
127
cde/programs/dtterm/tests/tabctrl/tabctrl.c
Normal file
127
cde/programs/dtterm/tests/tabctrl/tabctrl.c
Normal file
@@ -0,0 +1,127 @@
|
||||
/* $XConsortium: tabctrl.c /main/3 1995/10/31 12:02:15 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BELL 007
|
||||
#define BACKSPACE 010
|
||||
#define HORI_TAB 011
|
||||
#define NEWLINE 012
|
||||
#define VERTI_TAB 013
|
||||
#define NEWPAGE 014
|
||||
#define CARRI_RET 015
|
||||
|
||||
|
||||
|
||||
void TestTabCtrl(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i,j,k, l, Lines, Cols, TabSpace, TabCount;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0, 0);
|
||||
TabSpace = 5; /* how to take parameter */
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
ClearAllTabs();
|
||||
HomeUp();
|
||||
SetTab();
|
||||
TabCount = (Cols / TabSpace);
|
||||
if ((Cols % TabSpace) == 0) TabCount -= 1;
|
||||
for (i=0; i < TabCount; i++)
|
||||
{CursorForward(TabSpace); SetTab();}
|
||||
HomeUp();
|
||||
for (k=0; k < Lines; k++) {
|
||||
for (j=0; j < TabCount; j++) {
|
||||
sprintf(Str, "*%c", HORI_TAB); WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(1);
|
||||
#endif
|
||||
for (l=0; l < TabSpace-1; l++) {
|
||||
sprintf(Str, "%c", BACKSPACE); WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(1);
|
||||
#endif
|
||||
}
|
||||
for (l=0; l < TabSpace-1; l++)
|
||||
{sprintf(Str, "-");WRITETEST(Str);}
|
||||
}
|
||||
sprintf(Str, "*");WRITETEST(Str);
|
||||
for (l=0; l < ((Cols-1) % TabSpace); l++)
|
||||
{sprintf(Str, "-"); WRITETEST(Str);}
|
||||
if (k < (Lines -1)) {
|
||||
switch ((k % 3)) {
|
||||
case 0: sprintf(Str, "%c", NEWLINE); WRITETEST(Str); break;
|
||||
case 1: sprintf(Str, "%c%c", CARRI_RET, VERTI_TAB); WRITETEST(Str);
|
||||
break;
|
||||
case 2: sprintf(Str, "%c%c", CARRI_RET, NEWPAGE); WRITETEST(Str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%stabctrl1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
HomeUp();
|
||||
for (j=0; j < TabCount; j++)
|
||||
{sprintf(Str, "%c", HORI_TAB); WRITETEST(Str); ClearCurTab();}
|
||||
HomeUp(); ClearScreen();
|
||||
for (k=0; k < Lines; k++) {
|
||||
sprintf(Str, "*%c", HORI_TAB); WRITETEST(Str);
|
||||
sprintf(Str, "%c", NEWLINE); WRITETEST(Str);
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%stabctrl2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
HomeUp(); TabSpace = 8;
|
||||
TabCount = (Cols / TabSpace);
|
||||
if ((Cols % TabSpace) == 0) TabCount -= 1;
|
||||
for (i=0; i < TabCount; i++)
|
||||
{CursorForward(TabSpace); SetTab();}
|
||||
DONE();
|
||||
}
|
||||
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestTabCtrl("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user