Refactoring

This commit is contained in:
Michael Schimmel
2025-06-02 13:19:13 +02:00
parent 762e7f83e2
commit 48f4c945ce
9 changed files with 98 additions and 402 deletions
+8 -8
View File
@@ -94,7 +94,7 @@ const
CExpectedResult = 42;
begin
// Use TMycLatch.Null for an already set init state [cite: 71, 81, 206, 216, 324, 334]
LInitStateAsState := TMycLatch.Null.State; // Get IMycState from IMycLatch [cite: 61, 196, 314]
LInitStateAsState := State.Null;
LFuture := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitStateAsState,
function: Integer
@@ -120,7 +120,7 @@ var
const
CExpectedResult = 'ChainCompleted';
begin
LInitLatch := TMycLatch.CreateLatch(1); // Create an init state that is not yet set [cite: 77, 212, 330]
LInitLatch := State.CreateLatch(1); // Create an init state that is not yet set [cite: 77, 212, 330]
LFuture := TMycInitStateFuncFuture<string>.Create(FTaskFactory, LInitLatch.State,
function: string
@@ -155,7 +155,7 @@ const
begin
LExpectedExceptionRaisedByFactory := False;
LLocalTaskFactory := TMycTaskFactory.Create;
LInitStateAsState := TMycLatch.Null.State; // Immediate execution
LInitStateAsState := State.Null; // Immediate execution
LFuture := TMycInitStateFuncFuture<Integer>.Create(LLocalTaskFactory, LInitStateAsState,
function: Integer
@@ -208,7 +208,7 @@ var
LFuture: IMycFuture<Integer>;
LInitLatch: IMycLatch;
begin
LInitLatch := TMycLatch.CreateLatch(1);
LInitLatch := State.CreateLatch(1);
LFuture := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitLatch.State,
function: Integer
@@ -250,7 +250,7 @@ begin
FProcExecutionCount := 0; // Reset for this test
// Gate Latch: MainFuture waits for this latch, which needs 2 notifications.
LGateLatch := TMycLatch.CreateLatch(2); // [cite: 77, 212, 330]
LGateLatch := State.CreateLatch(2); // [cite: 77, 212, 330]
// Create MainFuture, AInitState is the GateLatch's state.
LMainFuture := TMycInitStateFuncFuture<string>.Create(FTaskFactory, LGateLatch.State,
@@ -262,7 +262,7 @@ begin
// Setup Prerequisite Futures
// PrerequisiteFuture1
LInitStateP1 := TMycLatch.CreateLatch(1); // Controllable init state for PF1
LInitStateP1 := State.CreateLatch(1); // Controllable init state for PF1
LPrerequisiteFuture1 := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitStateP1.State,
function: Integer
begin
@@ -273,7 +273,7 @@ begin
Subscriptions[1] := LPrerequisiteFuture1.Done.Subscribe(LSub1); // Subscribe to PF1's completion [cite: 56, 188, 306]
// PrerequisiteFuture2
LInitStateP2 := TMycLatch.CreateLatch(1); // Controllable init state for PF2
LInitStateP2 := State.CreateLatch(1); // Controllable init state for PF2
LPrerequisiteFuture2 := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LInitStateP2.State,
function: Integer
begin
@@ -322,7 +322,7 @@ begin
LFlagFutureBRan := False;
Self.FSharedCounter := 0; // Reset shared counter for this test
LTriggerLatch := TMycLatch.CreateLatch(1); // Single trigger [cite: 77, 212, 330]
LTriggerLatch := State.CreateLatch(1); // Single trigger [cite: 77, 212, 330]
// Future A
LFutureA := TMycInitStateFuncFuture<Integer>.Create(FTaskFactory, LTriggerLatch.State,