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