Code formatting
This commit is contained in:
@@ -69,7 +69,7 @@ begin
|
|||||||
Assert(IsLocked);
|
Assert(IsLocked);
|
||||||
|
|
||||||
if not Assigned(Receiver) then
|
if not Assigned(Receiver) then
|
||||||
exit( nil );
|
exit(nil);
|
||||||
|
|
||||||
Item := AllocItem;
|
Item := AllocItem;
|
||||||
Item.Receiver := Receiver;
|
Item.Receiver := Receiver;
|
||||||
@@ -185,16 +185,16 @@ begin
|
|||||||
if (Tag = nil) or (FList = nil) then
|
if (Tag = nil) or (FList = nil) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
{$ifdef DEBUG}
|
{$ifdef DEBUG}
|
||||||
Item := FList;
|
Item := FList;
|
||||||
while Item<>nil do
|
while Item <> nil do
|
||||||
begin
|
begin
|
||||||
if Item = Tag then
|
if Item = Tag then
|
||||||
break;
|
break;
|
||||||
Item := Item.Next;
|
Item := Item.Next;
|
||||||
end;
|
end;
|
||||||
Assert( Item <> nil, 'Receiver not advised' );
|
Assert(Item <> nil, 'Receiver not advised');
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
if FList = nil then
|
if FList = nil then
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ end;
|
|||||||
class function TMycFlag.CreateDirty: TFlag.IFlag;
|
class function TMycFlag.CreateDirty: TFlag.IFlag;
|
||||||
begin
|
begin
|
||||||
// Factory method to create a new TMycFlag instance.
|
// Factory method to create a new TMycFlag instance.
|
||||||
Result := TMycFlag.Create( true );
|
Result := TMycFlag.Create(true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TMycFlag.Destroy;
|
destructor TMycFlag.Destroy;
|
||||||
@@ -505,7 +505,7 @@ end;
|
|||||||
|
|
||||||
constructor TMycObserverFlag.Create(const ASignal: TSignal.ISignal);
|
constructor TMycObserverFlag.Create(const ASignal: TSignal.ISignal);
|
||||||
begin
|
begin
|
||||||
inherited Create( false );
|
inherited Create(false);
|
||||||
FSignal := ASignal;
|
FSignal := ASignal;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -363,7 +363,7 @@ end;
|
|||||||
|
|
||||||
class function TFlag.CreateFlag(Init: Boolean = false): TFlag;
|
class function TFlag.CreateFlag(Init: Boolean = false): TFlag;
|
||||||
begin
|
begin
|
||||||
Result := TMycFlag.Create( Init );
|
Result := TMycFlag.Create(Init);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TFlag.CreateObserver(const Signal: TSignal): TFlag;
|
class function TFlag.CreateObserver(const Signal: TSignal): TFlag;
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ var
|
|||||||
expectedValue: Integer;
|
expectedValue: Integer;
|
||||||
procExecuted: Boolean;
|
procExecuted: Boolean;
|
||||||
begin
|
begin
|
||||||
sourceDirty := TFlag.CreateFlag( true );
|
sourceDirty := TFlag.CreateFlag(true);
|
||||||
Assert.IsTrue(sourceDirty.State.IsSet, 'SourceDirty should be initially set for this test scenario');
|
Assert.IsTrue(sourceDirty.State.IsSet, 'SourceDirty should be initially set for this test scenario');
|
||||||
expectedValue := 70;
|
expectedValue := 70;
|
||||||
procExecuted := False;
|
procExecuted := False;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ end;
|
|||||||
|
|
||||||
function TTestMycDirtyFlag.CreateAndPrepareDirtyFlag(StartDirty: Boolean = True): TFlag.IFlag;
|
function TTestMycDirtyFlag.CreateAndPrepareDirtyFlag(StartDirty: Boolean = True): TFlag.IFlag;
|
||||||
begin
|
begin
|
||||||
Result := TFlag.CreateFlag( true ); // Initially dirty
|
Result := TFlag.CreateFlag(true); // Initially dirty
|
||||||
if not StartDirty then
|
if not StartDirty then
|
||||||
Result.Reset; // Reset to make it clean
|
Result.Reset; // Reset to make it clean
|
||||||
Assert.AreEqual(StartDirty, Result.State.IsSet, 'CreateAndPrepareDirtyFlag initial state incorrect.');
|
Assert.AreEqual(StartDirty, Result.State.IsSet, 'CreateAndPrepareDirtyFlag initial state incorrect.');
|
||||||
@@ -127,9 +127,9 @@ procedure TTestMycDirtyFlag.TestCreate_InitialStateIsDirty;
|
|||||||
var
|
var
|
||||||
dirtyFlag: TFlag.IFlag;
|
dirtyFlag: TFlag.IFlag;
|
||||||
begin
|
begin
|
||||||
dirtyFlag := TFlag.CreateFlag( true );
|
dirtyFlag := TFlag.CreateFlag(true);
|
||||||
Assert.IsTrue(dirtyFlag.State.IsSet, 'Newly created dirty flag should be IsSet.');
|
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.');
|
Assert.IsFalse(dirtyFlag.State.IsSet, 'Newly created dirty flag should not be IsSet.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user