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