Code formatting

This commit is contained in:
Michael Schimmel
2025-06-24 11:18:10 +02:00
parent fdea3cf26a
commit ed8619650c
5 changed files with 12 additions and 12 deletions
+5 -5
View File
@@ -69,7 +69,7 @@ begin
Assert(IsLocked);
if not Assigned(Receiver) then
exit( nil );
exit(nil);
Item := AllocItem;
Item.Receiver := Receiver;
@@ -185,16 +185,16 @@ begin
if (Tag = nil) or (FList = nil) then
exit;
{$ifdef DEBUG}
{$ifdef DEBUG}
Item := FList;
while Item<>nil do
while Item <> nil do
begin
if Item = Tag then
break;
Item := Item.Next;
end;
Assert( Item <> nil, 'Receiver not advised' );
{$endif}
Assert(Item <> nil, 'Receiver not advised');
{$endif}
if FList = nil then
exit;
+2 -2
View File
@@ -405,7 +405,7 @@ end;
class function TMycFlag.CreateDirty: TFlag.IFlag;
begin
// Factory method to create a new TMycFlag instance.
Result := TMycFlag.Create( true );
Result := TMycFlag.Create(true);
end;
destructor TMycFlag.Destroy;
@@ -505,7 +505,7 @@ end;
constructor TMycObserverFlag.Create(const ASignal: TSignal.ISignal);
begin
inherited Create( false );
inherited Create(false);
FSignal := ASignal;
end;
+1 -1
View File
@@ -363,7 +363,7 @@ end;
class function TFlag.CreateFlag(Init: Boolean = false): TFlag;
begin
Result := TMycFlag.Create( Init );
Result := TMycFlag.Create(Init);
end;
class function TFlag.CreateObserver(const Signal: TSignal): TFlag;
+1 -1
View File
@@ -411,7 +411,7 @@ var
expectedValue: Integer;
procExecuted: Boolean;
begin
sourceDirty := TFlag.CreateFlag( true );
sourceDirty := TFlag.CreateFlag(true);
Assert.IsTrue(sourceDirty.State.IsSet, 'SourceDirty should be initially set for this test scenario');
expectedValue := 70;
procExecuted := False;
+3 -3
View File
@@ -105,7 +105,7 @@ end;
function TTestMycDirtyFlag.CreateAndPrepareDirtyFlag(StartDirty: Boolean = True): TFlag.IFlag;
begin
Result := TFlag.CreateFlag( true ); // Initially dirty
Result := TFlag.CreateFlag(true); // Initially dirty
if not StartDirty then
Result.Reset; // Reset to make it clean
Assert.AreEqual(StartDirty, Result.State.IsSet, 'CreateAndPrepareDirtyFlag initial state incorrect.');
@@ -127,9 +127,9 @@ procedure TTestMycDirtyFlag.TestCreate_InitialStateIsDirty;
var
dirtyFlag: TFlag.IFlag;
begin
dirtyFlag := TFlag.CreateFlag( true );
dirtyFlag := TFlag.CreateFlag(true);
Assert.IsTrue(dirtyFlag.State.IsSet, 'Newly created dirty flag should be IsSet.');
dirtyFlag := TFlag.CreateFlag( false );
dirtyFlag := TFlag.CreateFlag(false);
Assert.IsFalse(dirtyFlag.State.IsSet, 'Newly created dirty flag should not be IsSet.');
end;