31 #include <gtest/gtest.h> 36 TEST(rtde_get_urcontrol_version, generate_serialized_get_urcontrol_version_request)
39 size_t expected_size = 3;
42 EXPECT_EQ(expected_size, actual_size);
44 uint8_t expected[] = { 0x00, 0x03, 0x76 };
45 for (
unsigned int i = 0; i < actual_size; ++i)
47 EXPECT_EQ(expected[i], buffer[i]);
51 TEST(rtde_get_urcontrol_version, parse_get_urcontrol_version)
53 uint8_t urcontrol_version_answer[] = { 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0c,
54 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 };
55 comm::BinParser bp(urcontrol_version_answer,
sizeof(urcontrol_version_answer));
58 EXPECT_TRUE(ur_control_version.
parseWith(bp));
61 expected_version_information.
major = 5;
62 expected_version_information.minor = 12;
63 expected_version_information.bugfix = 2;
64 expected_version_information.build = 0;
72 int main(
int argc,
char* argv[])
74 ::testing::InitGoogleTest(&argc, argv);
76 return RUN_ALL_TESTS();
virtual bool parseWith(comm::BinParser &bp)
Sets the attributes of the package by parsing a serialized representation of the package.
The BinParser class handles a byte buffer and functionality to iteratively parse the content...
VersionInformation version_information_
This class handles the package detailing the UR control version sent by the robot.
TEST(rtde_get_urcontrol_version, generate_serialized_get_urcontrol_version_request)
static size_t generateSerializedRequest(uint8_t *buffer)
Generates a serialized package.
int main(int argc, char *argv[])