Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user