DoTest: PROCEDURE[instHandle: AlpI.Handle, transHandle: AlpT.Handle] =
BEGIN
SetStopFalse[];
DO

--IF runningRandom THEN generate new values;
InitializeHistoryFile[nNormalTrans + nErrorTrans +
(nSharingTransSets*nTransPerSharingSet)];
--spawn off a bunch of processes;
--wait for them to join;
CheckConsistency[saveRestartValues: ((runningRandom) AND (IsStopFalse[]))];
DeleteFiles[TRUE];
IF (NOT runningRandom) THEN SetStopTrue[];
IF
IsStopTrue[] THEN EXIT;
ENDLOOP
;
IF transHandle.Finish[commit, FALSE] # commit THEN ERROR;
--unregproc;
END;


PackName
: PROCEDURE[rope: Rope.ROPE] RETURNS[packedName: PackedStringName] =
BEGIN
packedName.count ← rope.Length[];
FOR index: NAT IN [0..packedName.count)
DO
packedName.chars[index] ← rope.Fetch[index];
ENDLOOP;
END;



StopTest
: PROCEDURE =
BEGIN

SetStopTrue[];
END;


HistoryFileExists: ENTRY PROCEDURE RETURNS[exists: BOOLEAN, instHandle:
AlpInstance.Handle, refUniversalFile: REF AE.UniversalFile] =
BEGIN
exists ← TRUE;
[instHandle, refUniversalFile, ]AlpineInterimDirectory.Open[fileName: historyFileName,
createOptions: oldOnly, initialByteAllocation: 0
! AlpineInterimDirectory.Error => IF ((why = fileNotFound) OR (why = ownerNotFound))
THEN BEGIN
exists ← FALSE; CONTINUE; END];
END;


CleanUp
: PROCEDURE [deleteDataFilesAlso: BOOLEAN] =
BEGIN
DeleteFiles[deleteDataFilesAlso];
--Unregproc;
END;


SetStopFalse
: ENTRY PROCEDURE =
BEGIN
stop ← FALSE;
END;

SetStopTrue: ENTRY PROCEDURE =
BEGIN
stop ← TRUE;
END;

IsStopTrue: ENTRY PROCEDURE RETURNS[BOOLEAN]=
BEGIN
RETURN[(stop = TRUE)];
END;

IsStopFalse
: ENTRY PROCEDURE RETURNS[BOOLEAN]=
BEGIN
RETURN[(stop = FALSE)];
END;



stop: BOOLEANTRUE;

historyUniversalFile
: AE.UniversalFile;
historyLogNextPageNumber: AE.PageNumber;
historyLogMaxPageNumber: AE.PageNumber;



-- main line code:




END.