18 uint8_t dataForSerialize = 1;
19 const std::vector<char> expectedData = {1, 1};
20 GetStream() << dataForSerialize;
21 GetStream() << dataForSerialize;
23 ASSERT_EQ(expectedData, GetChannel().SerializedData);
28 uint8_t dataForSerialize = 1;
29 const std::vector<char> expectedData = {1};
30 GetStream() << dataForSerialize <<
flush;
31 GetStream() << dataForSerialize <<
flush;
32 ASSERT_EQ(expectedData, GetChannel().SerializedData);
41 uint8_t dataForSerialize = 1;
42 const std::vector<char> expectedData = { 1 };
43 GetStream() << dataForSerialize <<
flush;
44 ASSERT_EQ(expectedData, GetChannel().SerializedData);
49 int8_t dataForSerialize = 1;
50 const std::vector<char> expectedData = { 1 };
51 GetStream() << dataForSerialize <<
flush;
52 ASSERT_EQ(expectedData, GetChannel().SerializedData);
57 uint16_t dataForSerialize = 0x0102;
58 const std::vector<char> expectedData = {2, 1};
59 GetStream() << dataForSerialize <<
flush;
60 ASSERT_EQ(expectedData, GetChannel().SerializedData);
65 int16_t dataForSerialize = 0x0102;
66 const std::vector<char> expectedData = {2, 1};
67 GetStream() << dataForSerialize <<
flush;
68 ASSERT_EQ(expectedData, GetChannel().SerializedData);
73 uint32_t dataForSerialize = 0x01020304;
74 const std::vector<char> expectedData = {4, 3, 2, 1};
75 GetStream() << dataForSerialize <<
flush;
76 ASSERT_EQ(expectedData, GetChannel().SerializedData);
81 int32_t dataForSerialize = 0x01020304;
82 const std::vector<char> expectedData = {4, 3, 2, 1};
83 GetStream() << dataForSerialize <<
flush;
84 ASSERT_EQ(expectedData, GetChannel().SerializedData);
89 uint64_t dataForSerialize = 0x0102030405060708;
90 const std::vector<char> expectedData = {8, 7, 6, 5, 4, 3, 2, 1};
91 GetStream() << dataForSerialize <<
flush;
92 ASSERT_EQ(expectedData, GetChannel().SerializedData);
97 int64_t dataForSerialize = 0x0102030405060708;
98 const std::vector<char> expectedData = {8, 7, 6, 5, 4, 3, 2, 1};
99 GetStream() << dataForSerialize <<
flush;
100 ASSERT_EQ(expectedData, GetChannel().SerializedData);
106 const std::vector<char> expectedData = {8, 7, 6, 5, 4, 3, 2, 1};
107 GetStream() << dataForSerialize <<
flush;
108 ASSERT_EQ(expectedData, GetChannel().SerializedData);
114 dataForSerialize.
Data1 = 0x01020304;
115 dataForSerialize.
Data2 = 0x0506;
116 dataForSerialize.
Data3 = 0x0708;
118 for (
unsigned i = 0; i < 8; ++i)
120 dataForSerialize.
Data4[i] = i + 1;
123 const std::vector<char> expectedData =
128 1, 2, 3, 4, 5, 6, 7, 8
130 GetStream() << dataForSerialize <<
flush;
131 ASSERT_EQ(expectedData, GetChannel().SerializedData);
139 float dataForSerialize = -6.5;
140 const std::vector<char> expectedData = {0, 0, (char)0xD0, (
char)0xC0};
141 GetStream() << dataForSerialize <<
flush;
142 ASSERT_EQ(expectedData, GetChannel().SerializedData);
147 double dataForSerialize = 1200000;
149 const std::vector<char> expectedData = {0, 0, 0, 0, (char)0x80, (
char)0x4f, (char)0x32, (
char)0x41};
150 GetStream() << dataForSerialize <<
flush;
151 ASSERT_EQ(expectedData, GetChannel().SerializedData);
161 const std::vector<char> expectedData = {3, 0, 0, 0,
'u',
'r',
'l'};
162 GetStream() << dataForSerialize <<
flush;
163 ASSERT_EQ(expectedData, GetChannel().SerializedData);
169 const std::vector<char> expectedData(4, ~
char());
170 GetStream() << dataForSerialize <<
flush;
171 ASSERT_EQ(expectedData, GetChannel().SerializedData);
181 std::vector<uint8_t> dataForSerialize = {
'u',
'r',
'l'};
182 const std::vector<char> expectedData = {3, 0, 0, 0,
'u',
'r',
'l'};
183 GetStream() << dataForSerialize <<
flush;
184 ASSERT_EQ(expectedData, GetChannel().SerializedData);
189 GetStream() << std::vector<uint8_t>() <<
flush;
190 ASSERT_EQ(std::vector<char>(4, -1), GetChannel().SerializedData);
199 const std::vector<char> expectedData = {8, 7, 6, 5, 4, 3, 2, 1};
201 ASSERT_EQ(expectedData, GetChannel().SerializedData);
210 using namespace OpcUa;
218 GetStream() << lt <<
flush;
220 const std::vector<char> expectedData = {3, 2, 0, 0, 0,
'e',
'n', 4, 0, 0, 0,
't',
'e',
'x',
't'};
221 ASSERT_EQ(expectedData, GetChannel().SerializedData);
227 using namespace OpcUa;
235 GetStream() << lt <<
flush;
237 const std::vector<char> expectedData = {1, 2, 0, 0, 0,
'e',
'n'};
238 ASSERT_EQ(expectedData, GetChannel().SerializedData);
244 using namespace OpcUa;
252 GetStream() << lt <<
flush;
254 const std::vector<char> expectedData = {2, 4, 0, 0, 0,
't',
'e',
'x',
't'};
255 ASSERT_EQ(expectedData, GetChannel().SerializedData);
267 const std::vector<char> expectedData = {
'H',
'E',
'L'};
269 ASSERT_EQ(expectedData, GetChannel().SerializedData);
274 const std::vector<char> expectedData = {
'A',
'C',
'K'};
276 ASSERT_EQ(expectedData, GetChannel().SerializedData);
281 const std::vector<char> expectedData = {
'E',
'R',
'R'};
283 ASSERT_EQ(expectedData, GetChannel().SerializedData);
288 const std::vector<char> expectedData = {
'O',
'P',
'N'};
290 ASSERT_EQ(expectedData, GetChannel().SerializedData);
295 const std::vector<char> expectedData = {
'C',
'L',
'O'};
297 ASSERT_EQ(expectedData, GetChannel().SerializedData);
302 ASSERT_THROW(GetStream() << static_cast<OpcUa::Binary::MessageType>(-1), std::logic_error);
311 const std::vector<char> expectedData = {
'F'};
313 ASSERT_EQ(expectedData, GetChannel().SerializedData);
318 const std::vector<char> expectedData = {
'C'};
320 ASSERT_EQ(expectedData, GetChannel().SerializedData);
325 const std::vector<char> expectedData = {
'A'};
327 ASSERT_EQ(expectedData, GetChannel().SerializedData);
332 ASSERT_THROW(GetStream() << static_cast<OpcUa::Binary::ChunkType>(-1), std::logic_error);
344 hdr.
Size = 0x01020304;
346 const std::vector<char> expectedData = {
'H',
'E',
'L',
'F', 4, 3, 2, 1};
347 GetStream() << hdr <<
flush;
348 ASSERT_EQ(expectedData, GetChannel().SerializedData);
360 hdr.
Size = 0x01020304;
363 const std::vector<char> expectedData =
370 GetStream() << hdr <<
flush;
371 ASSERT_EQ(expectedData, GetChannel().SerializedData);
390 const std::vector<char> expectedData =
401 GetStream() << message <<
flush;
402 ASSERT_EQ(expectedData, GetChannel().SerializedData);
419 const std::vector<char> expectedData =
428 GetStream() << message <<
flush;
429 ASSERT_EQ(expectedData, GetChannel().SerializedData);
443 const std::vector<char> expectedData =
450 GetStream() << message <<
flush;
451 ASSERT_EQ(expectedData, GetChannel().SerializedData);
466 const std::vector<char> expectedData =
476 GetStream() << header <<
flush;
477 ASSERT_EQ(expectedData, GetChannel().SerializedData);
490 const std::vector<char> expectedData =
495 GetStream() << header <<
flush;
496 ASSERT_EQ(expectedData, GetChannel().SerializedData);
510 const std::vector<char> expectedData =
516 GetStream() << header <<
flush;
517 ASSERT_EQ(expectedData, GetChannel().SerializedData);
527 using namespace OpcUa;
537 const std::vector<char> expectedData =
549 GetStream() << header <<
flush;
551 ASSERT_EQ(expectedData, GetChannel().SerializedData);
562 using namespace OpcUa;
568 GetStream() << header <<
flush;
570 const std::vector<char> expectedData =
575 ASSERT_EQ(expectedData, GetChannel().SerializedData);
585 using namespace OpcUa;
591 GetStream() << info <<
flush;
593 const std::vector<char> expectedData =
598 ASSERT_EQ(expectedData, GetChannel().SerializedData);
604 using namespace OpcUa;
611 GetStream() << info <<
flush;
613 const std::vector<char> expectedData =
619 ASSERT_EQ(expectedData, GetChannel().SerializedData);
625 using namespace OpcUa;
633 GetStream() << info <<
flush;
635 const std::vector<char> expectedData =
642 ASSERT_EQ(expectedData, GetChannel().SerializedData);
648 using namespace OpcUa;
656 GetStream() << info <<
flush;
658 const std::vector<char> expectedData =
665 ASSERT_EQ(expectedData, GetChannel().SerializedData);
671 using namespace OpcUa;
679 GetStream() << info <<
flush;
681 const std::vector<char> expectedData =
688 ASSERT_EQ(expectedData, GetChannel().SerializedData);
694 using namespace OpcUa;
701 GetStream() << info <<
flush;
703 const std::vector<char> expectedData =
710 ASSERT_EQ(expectedData, GetChannel().SerializedData);
716 using namespace OpcUa;
723 GetStream() << info <<
flush;
725 const std::vector<char> expectedData =
731 ASSERT_EQ(expectedData, GetChannel().SerializedData);
743 using namespace OpcUa;
749 GetStream() << header <<
flush;
751 const std::vector<char> expectedData =
756 ASSERT_EQ(expectedData, GetChannel().SerializedData);
766 using namespace OpcUa;
778 GetStream() << request <<
flush;
780 const std::vector<char> expectedData =
782 1, 0, (char)0xbe, 0x1,
788 (uint32_t)SecurityTokenRequestType::Renew, 0, 0, 0,
789 (uint32_t)MessageSecurityMode::Sign, 0, 0, 0,
795 ASSERT_EQ(expectedData, GetChannel().SerializedData);
805 using namespace OpcUa;
810 token.SecureChannelId = 1;
812 token.CreatedAt.Value = 3;
813 token.RevisedLifetime = 4;
815 GetStream() << token <<
flush;
817 const std::vector<char> expectedData =
821 3, 0, 0, 0, 0, 0, 0, 0,
825 ASSERT_EQ(expectedData, GetChannel().SerializedData);
835 using namespace OpcUa;
853 GetStream() << response <<
flush;
855 const std::vector<char> expectedData =
857 1, 0, (char)0xC1, 0x1,
865 4, 0, 0, 0, 0, 0, 0, 0,
871 ASSERT_EQ(expectedData, GetChannel().SerializedData);
881 using namespace OpcUa;
892 GetStream() << request <<
flush;
894 const std::vector<char> expectedData =
896 1, 0, (char)0xc4, 0x1,
902 ASSERT_EQ(expectedData, GetChannel().SerializedData);
916 const std::vector<char> expectedData =
918 3, 0, 0, 0,
'a',
'e',
's',
919 4, 0, 0, 0, 1, 2, 3, 4
922 GetStream() << s <<
flush;
924 ASSERT_EQ(expectedData, GetChannel().SerializedData);
934 using namespace OpcUa;
939 GetStream() << header <<
flush;
941 const std::vector<char> expectedData =
943 1, 0, (char)0x41, 0x1,
947 ASSERT_EQ(expectedData, GetChannel().SerializedData);
957 using namespace OpcUa;
962 name.NamespaceIndex = 1;
965 GetStream() << name <<
flush;
967 const std::vector<char> expectedData =
970 4, 0, 0, 0,
'n',
'a',
'm',
'e' 974 ASSERT_EQ(expectedData, GetChannel().SerializedData);
983 using namespace OpcUa;
988 GetStream() <<
id <<
flush;
990 const std::vector<char> expectedData =
996 ASSERT_EQ(expectedData, GetChannel().SerializedData);
#define TEST_RESPONSE_HEADER_BINARY_DATA
TEST_F(TestInfoTest, Names)
MessageSecurityMode SecurityMode
std_msgs::Header * header(M &m)
std::string AdditionalInfo
OStream< ChannelType > & flush(OStream< ChannelType > &os)
#define ASSERT_THROW(statement, expected_exception)
uint32_t ServerProtocolVersion
#define FILL_TEST_RESPONSE_HEADER(header)
#define TEST_REQUEST_HEADER_BINARY_DATA
#define FILL_TEST_REQUEST_HEADER(header)
uint32_t ClientProtocolVersion
DiagnosticInfoMask EncodingMask
struct OpcUa::NodeId::FourByteDataType FourByteData
SecurityToken ChannelSecurityToken
OPC UA Address space part. GNU LGPL.
std::vector< uint8_t > ClientNonce
OpenSecureChannelParameters Parameters
struct OpcUa::NodeId::StringDataType StringData
#define ASSERT_EQ(val1, val2)
StatusCode InnerStatusCode
uint32_t ReceiveBufferSize
SecurityTokenRequestType RequestType
uint32_t ReceiveBufferSize
OpcUa::ByteString Signature
std::size_t RawSize(const T &obj)
std::vector< uint8_t > ServerNonce