-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(examples/[no ci): Add examples
- Loading branch information
1 parent
df48f25
commit 9b987f5
Showing
11 changed files
with
127 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...nappy.examples.PRG_TcUnit.fbTcunitExample.Test some stuff with TcHaxx.Snappy.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
sString: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy, | ||
nNumber: 3735928559, | ||
fFloat: -1.2345678, | ||
aBuffer: [ | ||
1, | ||
2, | ||
3, | ||
4, | ||
5, | ||
6, | ||
7, | ||
8, | ||
9, | ||
10, | ||
11, | ||
12, | ||
13, | ||
14, | ||
15, | ||
16 | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
examples/examples/POUs/FB_TcUnitWithoutSnappyExample.TcPOU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12"> | ||
<POU Name="FB_TcUnitWithoutSnappyExample" Id="{43b4abf0-a389-4bd6-9155-50172d18c287}" SpecialFunc="None"> | ||
<Declaration><![CDATA[FUNCTION_BLOCK FB_TcUnitWithoutSnappyExample EXTENDS FB_TestSuite | ||
VAR | ||
stActual : ST_DemoDataType; | ||
stActual2 : ST_DemoDataType; | ||
END_VAR | ||
VAR CONSTANT | ||
cStringExpected : STRING := 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy'; | ||
cBufferExpected : ARRAY[0..15] OF BYTE := [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; | ||
END_VAR | ||
]]></Declaration> | ||
<Implementation> | ||
<ST><![CDATA[ | ||
TEST('Test some stuff without TcHaxx.Snappy'); | ||
// ARRANGE | ||
// ACT | ||
stActual := F_CreateDemoData(); | ||
// ASSERT | ||
AssertEquals_STRING(Expected:= cStringExpected, | ||
Actual:= stActual.sString, | ||
Message:= 'Field sString differs.'); | ||
AssertEquals_UDINT(Expected:= 16#DEADBEEF, | ||
Actual:= stActual.nNumber, | ||
Message:= 'Field nNumber differs.'); | ||
AssertEquals_REAL(Expected:= -1.23456789, | ||
Actual:= stActual.fFloat, | ||
Delta:= 0.00001, | ||
Message:= 'Field fFloat differs.'); | ||
AssertArrayEquals_BYTE(Expecteds:= cBufferExpected, | ||
Actuals:= stActual.aBuffer, | ||
Message:= 'Field aBuffer differs.'); | ||
stActual2 := stActual; | ||
stActual2.aBuffer[3]:= 55; | ||
AssertEquals(stActual2, stActual, 'Oh snap!'); | ||
TEST_FINISHED_NAMED('Test some stuff without TcHaxx.Snappy');]]></ST> | ||
</Implementation> | ||
</POU> | ||
</TcPlcObject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters