unittest_modbus_msg_wrapper.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Pilz GmbH & Co. KG
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13 
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include <gtest/gtest.h>
19 
20 #include <memory>
21 #include <vector>
22 
27 
28 using namespace prbt_hardware_support;
29 
31 {
32 
34 
39 TEST(ModbusMsgWrapperTest, testModbusMsgWrapperDtor)
40 {
41  uint32_t offset{0};
42  const uint16_t modbus_api_version {1};
43  RegCont holding_register {modbus_api_version};
44  ModbusMsgInStampedPtr msg{ModbusMsgInBuilder::createDefaultModbusMsgIn(offset, holding_register)};
45 
46  ModbusMsgInStampedConstPtr msg_const_ptr {msg};
47  std::shared_ptr<ModbusMsgWrapper> ex(new ModbusMsgWrapper(msg_const_ptr, test_api_spec));
48 }
49 
50 } // namespace modbus_msg_wrapper
51 
52 int main(int argc, char *argv[])
53 {
54  testing::InitGoogleTest(&argc, argv);
55  return RUN_ALL_TESTS();
56 }
msg
int main(int argc, char *argv[])
std::vector< uint16_t > RegCont
Convenience data type defining the data type for a collection of registers.
static ModbusMsgInStampedPtr createDefaultModbusMsgIn(const std_msgs::MultiArrayLayout::_data_offset_type &offset, const RegCont &holding_register)
Creates a standard ModbusMsgIn which contains default values for all essential elements of the messag...
TEST(IntegrationtestExecuteBrakeTest, testBrakeTestService)
Wrapper class to add semantic to a raw ModbusMsgInStamped.
Specifies the meaning of the holding registers.


prbt_hardware_support
Author(s):
autogenerated on Tue Feb 2 2021 03:50:17