-
Notifications
You must be signed in to change notification settings - Fork 923
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stringtables for diagnostic results when service calls are batched (
#2222) - Issue fix: Currently when diagnostics is enabled in client calls, the string table in the response header is not updated when a service call is split into multiple service calls. In this case the stringtables from all calls must be appended and the index in the diagnosticinfo must be updated to match the updated string list. - To reduce the number of 'null' DiagnosticInfo allocations, the decoders now try to return null instead of a default DiagnosticInfo. A new property ÌsNullDiagnosticInfo' can be used to check for unused DiagnosticInfo entries. - The tests were slightly improved to use test set data from the generated TestData namespace, which contains also a historical node. - All `ServerFixtureUtils.ValidateXXX` checks were updated to include the check for diagnosticInfos and the string tables to catch issues.
- Loading branch information
Showing
16 changed files
with
560 additions
and
224 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
Applications/Quickstarts.Servers/TestData/NodeStateComparer.cs
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,72 @@ | ||
/* ======================================================================== | ||
* Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. | ||
* | ||
* OPC Foundation MIT License 1.00 | ||
* | ||
* Permission is hereby granted, free of charge, to any person | ||
* obtaining a copy of this software and associated documentation | ||
* files (the "Software"), to deal in the Software without | ||
* restriction, including without limitation the rights to use, | ||
* copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following | ||
* conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* The complete license agreement can be found here: | ||
* http://opcfoundation.org/License/MIT/1.00/ | ||
* ======================================================================*/ | ||
|
||
using System.Collections.Generic; | ||
using Opc.Ua; | ||
|
||
namespace TestData | ||
{ | ||
/// <summary> | ||
/// Helper which implements IEqualityComparer for Linq queries. | ||
/// </summary> | ||
public class NodeStateComparer : IEqualityComparer<NodeState> | ||
{ | ||
/// <inheritdoc/> | ||
public bool Equals(NodeState x, NodeState y) | ||
{ | ||
if (ReferenceEquals(x, y)) | ||
{ | ||
return true; | ||
} | ||
|
||
if (ReferenceEquals(x, null) || ReferenceEquals(y, null)) | ||
{ | ||
return false; | ||
} | ||
|
||
if (x.NodeId == y.NodeId) | ||
{ | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public int GetHashCode(NodeState node) | ||
{ | ||
if (ReferenceEquals(node, null)) | ||
{ | ||
return 0; | ||
} | ||
|
||
return node.NodeId.GetHashCode(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.