30 using namespace OpcUa;
35 GetStream() << var <<
flush;
37 const std::vector<char> expectedData =
43 ASSERT_EQ(expectedData, GetChannel().SerializedData) <<
PrintData(GetChannel().SerializedData) << std::endl <<
PrintData(expectedData);
49 using namespace OpcUa;
54 GetStream() << var <<
flush;
57 const std::vector<char> expectedData =
64 ASSERT_EQ(expectedData, GetChannel().SerializedData) <<
PrintData(GetChannel().SerializedData) << std::endl <<
PrintData(expectedData);
70 using namespace OpcUa;
73 Variant var = std::vector<bool> {
true,
true};
75 GetStream() << var <<
flush;
78 const std::vector<char> expectedData =
87 ASSERT_EQ(expectedData, GetChannel().SerializedData) <<
PrintData(GetChannel().SerializedData) << std::endl <<
PrintData(expectedData);
94 using namespace OpcUa;
100 GetStream() << var <<
flush;
103 const std::vector<char> expectedData =
112 ASSERT_EQ(expectedData, GetChannel().SerializedData) <<
PrintData(GetChannel().SerializedData) << std::endl <<
PrintData(expectedData);
122 using namespace OpcUa;
125 const std::vector<char> expectedData =
130 GetChannel().SetData(expectedData);
142 using namespace OpcUa;
147 const std::vector<char> expectedData =
153 GetChannel().SetData(expectedData);
166 using namespace OpcUa;
171 const std::vector<char> expectedData =
179 GetChannel().SetData(expectedData);
185 std::vector<bool> vals;
197 using namespace OpcUa;
202 const std::vector<char> expectedData =
210 GetChannel().SetData(expectedData);
223 using namespace OpcUa;
228 const std::vector<char> expectedData =
234 GetChannel().SetData(expectedData);
247 using namespace OpcUa;
252 const std::vector<char> expectedData =
260 GetChannel().SetData(expectedData);
266 std::vector<uint8_t> vals;
279 using namespace OpcUa;
284 const std::vector<char> expectedData =
293 GetChannel().SetData(expectedData);
309 using namespace OpcUa;
314 const std::vector<char> expectedData =
320 GetChannel().SetData(expectedData);
333 using namespace OpcUa;
338 const std::vector<char> expectedData =
346 GetChannel().SetData(expectedData);
352 std::vector<int8_t> vals;
365 using namespace OpcUa;
370 const std::vector<char> expectedData =
378 GetChannel().SetData(expectedData);
392 using namespace OpcUa;
397 const std::vector<char> expectedData =
403 GetChannel().SetData(expectedData);
417 using namespace OpcUa;
422 const std::vector<char> expectedData =
430 GetChannel().SetData(expectedData);
436 std::vector<int16_t> vals;
449 using namespace OpcUa;
454 const std::vector<char> expectedData =
462 GetChannel().SetData(expectedData);
478 using namespace OpcUa;
483 const std::vector<char> expectedData =
489 GetChannel().SetData(expectedData);
503 using namespace OpcUa;
508 const std::vector<char> expectedData =
516 GetChannel().SetData(expectedData);
522 std::vector<uint16_t> vals;
535 using namespace OpcUa;
540 const std::vector<char> expectedData =
548 GetChannel().SetData(expectedData);
564 using namespace OpcUa;
569 const std::vector<char> expectedData =
575 GetChannel().SetData(expectedData);
589 using namespace OpcUa;
594 const std::vector<char> expectedData =
602 GetChannel().SetData(expectedData);
608 std::vector<int32_t> vals;
621 using namespace OpcUa;
626 const std::vector<char> expectedData =
634 GetChannel().SetData(expectedData);
650 using namespace OpcUa;
655 const std::vector<char> expectedData =
661 GetChannel().SetData(expectedData);
675 using namespace OpcUa;
680 const std::vector<char> expectedData =
688 GetChannel().SetData(expectedData);
694 std::vector<uint32_t> vals;
707 using namespace OpcUa;
712 const std::vector<char> expectedData =
720 GetChannel().SetData(expectedData);
736 using namespace OpcUa;
741 const std::vector<char> expectedData =
744 0x00, 0x20, 0, 0, 0, 0, 0, 0
747 GetChannel().SetData(expectedData);
761 using namespace OpcUa;
766 const std::vector<char> expectedData =
770 0x00, 0x20, 0, 0, 0, 0, 0, 0,
771 0x00, 0x20, 0, 0, 0, 0, 0, 0
774 GetChannel().SetData(expectedData);
780 std::vector<int64_t> vals;
793 using namespace OpcUa;
798 const std::vector<char> expectedData =
801 0x00, 0x20, 0, 0, 0, 0, 0, 0,
806 GetChannel().SetData(expectedData);
822 using namespace OpcUa;
827 const std::vector<char> expectedData =
830 0x00, 0x20, 0, 0, 0, 0, 0, 0
833 GetChannel().SetData(expectedData);
847 using namespace OpcUa;
852 const std::vector<char> expectedData =
856 0x00, 0x20, 0, 0, 0, 0, 0, 0,
857 0x00, 0x20, 0, 0, 0, 0, 0, 0
860 GetChannel().SetData(expectedData);
866 std::vector<uint64_t> vals;
879 using namespace OpcUa;
884 const std::vector<char> expectedData =
887 0x00, 0x20, 0, 0, 0, 0, 0, 0,
892 GetChannel().SetData(expectedData);
908 using namespace OpcUa;
913 const std::vector<char> expectedData =
917 0, 0, (char)0xD0, (
char)0xC0
920 GetChannel().SetData(expectedData);
934 using namespace OpcUa;
939 const std::vector<char> expectedData =
943 0, 0, (char)0xD0, (
char)0xC0,
944 0, 0, (char)0xD0, (
char)0xC0
949 GetChannel().SetData(expectedData);
955 std::vector<float> vals;
968 using namespace OpcUa;
973 const std::vector<char> expectedData =
976 0, 0, (char)0xD0, (
char)0xC0,
982 GetChannel().SetData(expectedData);
998 using namespace OpcUa;
1003 const std::vector<char> expectedData =
1006 0, 0, 0, 0, (char)0x80, (
char)0x4f, (char)0x32, (
char)0x41
1009 GetChannel().SetData(expectedData);
1023 using namespace OpcUa;
1028 const std::vector<char> expectedData =
1032 0, 0, 0, 0, (char)0x80, (
char)0x4f, (char)0x32, (
char)0x41,
1033 0, 0, 0, 0, (char)0x80, (
char)0x4f, (char)0x32, (
char)0x41
1036 GetChannel().SetData(expectedData);
1042 std::vector<double> vals;
1055 using namespace OpcUa;
1060 const std::vector<char> expectedData =
1063 0, 0, 0, 0, (char)0x80, (
char)0x4f, (char)0x32, (
char)0x41,
1068 GetChannel().SetData(expectedData);
1084 guid.
Data1 = 0x01020304;
1085 guid.
Data2 = 0x0506;
1086 guid.
Data3 = 0x0708;
1088 for (
unsigned i = 0; i < 8; ++i)
1090 guid.
Data4[i] = i + 1;
1099 using namespace OpcUa;
1104 const std::vector<char> expectedData =
1107 4, 3, 2, 1, 6, 5, 8, 7, 1, 2, 3, 4, 5, 6, 7, 8
1110 GetChannel().SetData(expectedData);
1126 using namespace OpcUa;
1131 const std::vector<char> expectedData =
1135 4, 3, 2, 1, 6, 5, 8, 7, 1, 2, 3, 4, 5, 6, 7, 8,
1136 4, 3, 2, 1, 6, 5, 8, 7, 1, 2, 3, 4, 5, 6, 7, 8
1139 GetChannel().SetData(expectedData);
1147 std::vector<Guid> vals;
1160 using namespace OpcUa;
1165 const std::vector<char> expectedData =
1168 4, 3, 2, 1, 6, 5, 8, 7, 1, 2, 3, 4, 5, 6, 7, 8,
1173 GetChannel().SetData(expectedData);
1191 using namespace OpcUa;
1196 const std::vector<char> expectedData =
1199 4, 0, 0, 0,
'R',
'o',
'o',
't' 1202 GetChannel().SetData(expectedData);
1216 using namespace OpcUa;
1221 const std::vector<char> expectedData =
1225 4, 0, 0, 0,
'R',
'o',
'o',
't',
1226 4, 0, 0, 0,
'R',
'o',
'o',
't' 1229 GetChannel().SetData(expectedData);
1237 std::vector<std::string> vals;
1250 using namespace OpcUa;
1255 const std::vector<char> expectedData =
1258 4, 0, 0, 0,
'R',
'o',
'o',
't',
1263 GetChannel().SetData(expectedData);
1281 using namespace OpcUa;
1286 const std::vector<char> expectedData =
1292 GetChannel().SetData(expectedData);
1306 using namespace OpcUa;
1311 const std::vector<char> expectedData =
1319 GetChannel().SetData(expectedData);
1325 std::vector<ByteString> vals;
1338 using namespace OpcUa;
1343 const std::vector<char> expectedData =
1351 GetChannel().SetData(expectedData);
1369 using namespace OpcUa;
1374 const std::vector<char> expectedData =
1377 8, 7, 6, 5, 4, 3, 2, 1
1380 GetChannel().SetData(expectedData);
1394 using namespace OpcUa;
1399 const std::vector<char> expectedData =
1403 8, 7, 6, 5, 4, 3, 2, 1,
1404 8, 7, 6, 5, 4, 3, 2, 1
1407 GetChannel().SetData(expectedData);
1413 std::vector<DateTime> vals;
1426 using namespace OpcUa;
1431 const std::vector<char> expectedData =
1434 8, 7, 6, 5, 4, 3, 2, 1,
1439 GetChannel().SetData(expectedData);
1455 using namespace OpcUa;
1460 const std::vector<char> expectedData =
1463 2, 4, 0, 0, 0,
't',
'e',
'x',
't' 1466 GetChannel().SetData(expectedData);
1480 using namespace OpcUa;
1485 const std::vector<char> expectedData =
1489 2, 4, 0, 0, 0,
't',
'e',
'x',
't',
1490 2, 4, 0, 0, 0,
't',
'e',
'x',
't' 1493 GetChannel().SetData(expectedData);
1499 std::vector<LocalizedText> vals;
1512 using namespace OpcUa;
1517 const std::vector<char> expectedData =
1520 2, 4, 0, 0, 0,
't',
'e',
'x',
't',
1525 GetChannel().SetData(expectedData);
1541 using namespace OpcUa;
1546 const std::vector<char> expectedData =
1549 1, 0, 4, 0, 0, 0,
'n',
'a',
'm',
'e' 1552 GetChannel().SetData(expectedData);
1566 using namespace OpcUa;
1571 const std::vector<char> expectedData =
1575 1, 0, 4, 0, 0, 0,
'n',
'a',
'm',
'e',
1576 1, 0, 4, 0, 0, 0,
'n',
'a',
'm',
'e' 1579 GetChannel().SetData(expectedData);
1585 std::vector<QualifiedName> vals;
1598 using namespace OpcUa;
1603 const std::vector<char> expectedData =
1606 1, 0, 4, 0, 0, 0,
'n',
'a',
'm',
'e',
1611 GetChannel().SetData(expectedData);
1627 using namespace OpcUa;
1632 const std::vector<char> expectedData =
1635 1, 0, (char)0xC1, 0x1
1638 GetChannel().SetData(expectedData);
1652 using namespace OpcUa;
1657 const std::vector<char> expectedData =
1661 1, 0, (char)0xC1, 0x1,
1662 1, 0, (
char)0xC1, 0x1
1665 GetChannel().SetData(expectedData);
1671 std::vector<NodeId> vals;
1683 using namespace OpcUa;
1688 const std::vector<char> expectedData =
1691 1, 0, (char)0xC1, 0x1,
1696 GetChannel().SetData(expectedData);
1740 const std::vector<bool> vec{
true,
false};
std::string PrintData(const std::vector< char > &vec)
Test of opc ua binary handshake. GNU LGPL.
OpcUa::Guid CreateTestGuid()
const uint8_t HAS_DIMENSIONS_MASK
const uint8_t HAS_ARRAY_MASK
OStream< ChannelType > & flush(OStream< ChannelType > &os)
#define ASSERT_NE(val1, val2)
#define ASSERT_NO_THROW(statement)
OPC UA Address space part. GNU LGPL.
#define ASSERT_TRUE(condition)
std::vector< uint32_t > Dimensions
#define ASSERT_EQ(val1, val2)
TEST_F(OpcUaBinarySerialization, Variant_NUL)
Test of opc ua binary attributes. GNU LGPL.
TEST(Variant, InitializeNUL)
#define ASSERT_FALSE(condition)
NodeId FourByteNodeId(uint16_t value, uint8_t namespaceIndex=0)
std::size_t RawSize(const T &obj)