From 54864d48831b67c0ca47caee29835a4b60d0f9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Seidel?= Date: Tue, 13 Feb 2024 17:08:29 +0100 Subject: [PATCH] reset flat document --- test/Document/TestResetFlatDocument.st | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/test/Document/TestResetFlatDocument.st b/test/Document/TestResetFlatDocument.st index 08c1b59..be6d55c 100644 --- a/test/Document/TestResetFlatDocument.st +++ b/test/Document/TestResetFlatDocument.st @@ -4,9 +4,9 @@ USING Simatic.Ax.Conversion; USING Simatic.Ax.Json; NAMESPACE Document + {TestFixture} CLASS TestResetFlatDocument - VAR PROTECTED e1 : JsonDInt := (Value := 999, Key := 'e1'); e2 : JsonBoolean := (Key := 'e2', Value := TRUE); @@ -15,21 +15,18 @@ NAMESPACE Document oi1 : JsonSInt := (Key := 'oi1', Value := SINT#1); oi2 : JsonSInt := (Key := 'oi2', Value := SINT#1); e4 : JsonLInt := (Key := 'e4', Value := LINT#1); - - doc : JsonDocument; cmpBuff : ARRAY[0..399] OF CHAR; cmpBuffEmpty : ARRAY[0..399] OF CHAR; len : DINT; END_VAR - + {Test} METHOD PUBLIC Reset_flat_document_removes_all_next_elements_from_the_json_objects VAR_TEMP _to : IJsonElementMuteable; - _elem : IJsonElement; + _elem : IJsonElement; END_VAR - doc.AddElement(e1); doc.AddElement(e2); doc.AddElement(e3); @@ -37,10 +34,7 @@ NAMESPACE Document doc.AddElement(e4); o1.AddElement(oi1); o1.AddElement(oi2); - - doc.Reset(); - Equal(expected := FALSE, actual := e1.HasNext()); Equal(expected := FALSE, actual := e2.HasNext()); Equal(expected := FALSE, actual := e3.HasNext()); @@ -50,8 +44,7 @@ NAMESPACE Document Equal(expected := FALSE, actual := oi2.HasNext()); Equal(expected := TRUE, actual := doc.GetRootElement() = NULL); Equal(expected := DINT#0, actual := doc.GetLength()); - END_METHOD - END_CLASS -END_NAMESPACE \ No newline at end of file + +END_NAMESPACE