Skip to content

Commit

Permalink
Merge pull request #1 from AndyP01/updates
Browse files Browse the repository at this point in the history
Updates for 0.3.1
  • Loading branch information
benhar-dev committed Mar 21, 2023
2 parents 25f73c0 + ac786a2 commit 26197cd
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 20 deletions.
11 changes: 10 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Changelog

## 0.3.1

### Disposable

- Renamed the test suite.
- Removed Mock classes that used OnDispose method.
- Fixed typos and text.
- Fixed test project to use specific version (0.3.1) of library.

## 0.3.0

### Disposable

- Removed OnDispose. Due to new information being provided in regards to how fb_exit operates it is no longer possible to implement the OnDispose method in this way. fb_exit is not follow the same rules as an inherited method, and as such would have only called OnDispose at the point when the disposable abstract class was destroyed. NOT at the point that a child class is destroyed. This is a subtle issue which is worth removing this functionality for. If left in could have resulted in some very hard to find bugs in the user code.
- Removed OnDispose. Due to new information being provided in regards to how FB_exit operates it is no longer possible to implement the OnDispose method in this way. FB_exit does not follow the same rules as an inherited method, and as such would have only called OnDispose at the point when the disposable abstract class was destroyed, NOT at the point that a child class is destroyed. This is a subtle issue which is worth removing this functionality for. If left in it could have resulted in some very hard to find bugs in the user code.

## 0.2.1

Expand Down
2 changes: 1 addition & 1 deletion docs/disposable.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Remarks

The Disposable Abstract Class is a utility class that allows objects to handle being destroyed in a consistent manor.
The Disposable Abstract Class is a utility class that allows objects to handle being destroyed in a consistent manner.

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<Implicit_KindOfTask>{bdb18625-7f73-478e-8487-05b781fdd812}</Implicit_KindOfTask>
<Implicit_Jitter_Distribution>{265acaef-25ec-40b4-b683-d0f00dcaa266}</Implicit_Jitter_Distribution>
<LibraryReferences>{e11883e5-13ac-4d0c-bd30-db5996ce662d}</LibraryReferences>
<Released>false</Released>
</PropertyGroup>
<ItemGroup>
<Compile Include="PlcTask.TcTTO">
Expand All @@ -23,18 +24,12 @@
<Compile Include="POUs\MAIN.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tests\Disposable_TestSuit.TcPOU">
<Compile Include="Tests\Disposable_TestSuite.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tests\Mocks\MockDisposable.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tests\Mocks\MockDisposableWithCancel.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tests\Mocks\MockDisposableWithExplicitFeedback.TcPOU">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="POUs" />
Expand Down Expand Up @@ -68,6 +63,11 @@
<SubType>Content</SubType>
</None>
</ItemGroup>
<ItemGroup>
<PlaceholderResolution Include="mobject-disposable">
<Resolution>mobject-disposable, 0.3.1 (mobject)</Resolution>
</PlaceholderResolution>
</ItemGroup>
<ProjectExtensions>
<PlcProjectOptions>
<XmlArchive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<POU Name="MAIN" Id="{9d67fa5f-b22b-413d-bd2f-078ef7b27582}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM MAIN
VAR
eventEmitter_TestSuit : Disposable_TestSuit;
disposable_TestSuite : Disposable_TestSuite;
END_VAR
]]></Declaration>
<Implementation>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="Disposable_TestSuit" Id="{5e30d77d-5ab7-4a68-9932-9d53fc3729bd}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK PUBLIC Disposable_TestSuit EXTENDS TcUnit.FB_TestSuite
<POU Name="Disposable_TestSuite" Id="{5e30d77d-5ab7-4a68-9932-9d53fc3729bd}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK PUBLIC Disposable_TestSuite EXTENDS TcUnit.FB_TestSuite
VAR
END_VAR
]]></Declaration>
Expand All @@ -28,7 +28,7 @@ __DELETE(mockDispose);
// @TEST-ASSSERT
AssertTrue(
Condition := disposed,
Message := 'OnDispose was not correctly triggered in the MockDisposable'
Message := 'FB_exit was not correctly triggered in the MockDisposable'
);
TEST_FINISHED();]]></ST>
Expand All @@ -53,7 +53,7 @@ mockDispose^.Dispose();
// @TEST-ASSSERT
AssertTrue(
Condition := disposed,
Message := 'OnDispose was not correctly triggered in the MockDisposable'
Message := 'FB_exit was not correctly triggered in the MockDisposable'
);
TEST_FINISHED();]]></ST>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</System>
<Plc>
<Project GUID="{99410A04-EDBC-4BE9-8215-58B13429C019}" Name="Main" PrjFilePath="Main\Main.plcproj" TmcFilePath="Main\Main.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="Main\Main.tmc" TmcHash="{8DA6D5F0-0B8C-DEB7-4161-4E337FBB0457}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="Main\Main.tmc" TmcHash="{9AEEE51F-852A-9760-D5BE-24C79542E46B}">
<Name>Main Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Contexts>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ IF bInCopyCode THEN
RETURN;
END_IF
// A word of warning. fb_exit does not NOT operate in the same way as a typical inherited method. If a child class does not implement fb_exit then it does not
// A word of warning. FB_exit does not NOT operate in the same way as a typical inherited method. If a child class does not implement FB_exit then it does not
// gain this one for itself.
// The system will automatically call each fb_exit on each layer of inheritance one by one, starting with the child class and making it's way to the parent.
// Therefore code in here will only be triggered once the system reaches this layer of the object's deletion. So by this point, the child class and
// all of it's variables will already have had fb_exit called by the time we reach this point!]]></ST>
// The system will automatically call each FB_exit on each layer of inheritance one by one, starting with the child class and making it's way to the parent.
// Therefore code in here will only be triggered once the system reaches this layer of the object's deletion. The child class and all of it's variables
// will already have had FB_exit called by the time we reach this point!]]></ST>
</Implementation>
</Method>
</POU>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Company>mobject</Company>
<Released>false</Released>
<Title>mobject-disposable</Title>
<ProjectVersion>0.3.0</ProjectVersion>
<ProjectVersion>0.3.1</ProjectVersion>
<DefaultNamespace>mobject-disposable</DefaultNamespace>
<Author>mobject dev team</Author>
<LibraryCategories>
Expand Down

0 comments on commit 26197cd

Please sign in to comment.