You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/06/05 13:54:57 UTC

[plc4x] branch develop updated: test(plc4go/spi): output produced bytes for plc response in DriverTestRunner

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 117d669ce4 test(plc4go/spi): output produced bytes for plc response in DriverTestRunner
117d669ce4 is described below

commit 117d669ce40f8e0bc65b8e47d45a8036ac3d0469
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon Jun 5 15:54:49 2023 +0200

    test(plc4go/spi): output produced bytes for plc response in DriverTestRunner
---
 plc4go/spi/testutils/DriverTestRunner.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plc4go/spi/testutils/DriverTestRunner.go b/plc4go/spi/testutils/DriverTestRunner.go
index a4d5d8db2b..bbc1384b1f 100644
--- a/plc4go/spi/testutils/DriverTestRunner.go
+++ b/plc4go/spi/testutils/DriverTestRunner.go
@@ -366,6 +366,7 @@ func (m DriverTestsuite) ExecuteStep(t *testing.T, connection plc4go.PlcConnecti
 		if err != nil {
 			return errors.Wrap(err, "error decoding hex-encoded byte data")
 		}
+		t.Logf("\n%s", hex.Dump(expectedRawInput))
 		rawInput := testTransportInstance.DrainWriteBuffer(uint32(len(expectedRawInput)))
 
 		// Compare the bytes read with the ones we expect
@@ -408,7 +409,9 @@ func (m DriverTestsuite) ExecuteStep(t *testing.T, connection plc4go.PlcConnecti
 
 		// Send these bytes to the transport
 		t.Log("Writing to transport")
-		testTransportInstance.FillReadBuffer(wb.GetBytes())
+		_bytes := wb.GetBytes()
+		t.Logf("\n%s", hex.Dump(_bytes))
+		testTransportInstance.FillReadBuffer(_bytes)
 	case StepTypeIncomingPlcBytes:
 		// Get the raw hex-data.
 		t.Log("Get hex data")
@@ -419,6 +422,7 @@ func (m DriverTestsuite) ExecuteStep(t *testing.T, connection plc4go.PlcConnecti
 
 		// Send these bytes to the transport
 		t.Log("Writing bytes to transport")
+		t.Logf("\n%s", hex.Dump(rawInput))
 		testTransportInstance.FillReadBuffer(rawInput)
 	case StepTypeDelay:
 		// Get the number of milliseconds