iCub-main
testUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  * Author: Luca Tricerri
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #pragma once
10 
11 #include "EoBoards.h"
14 
16 {
17  public:
26 
28 };
29 
31 {
32  public:
39 
41 };
42 
43 inline bool operator==(const eObrd_canmonitor_cfg_t &right, const eObrd_canmonitor_cfg_t &left)
44 {
45  if (right.periodofcheck != left.periodofcheck)
46  return false;
47  if (right.reportmode != left.reportmode)
48  return false;
49  if (right.periodofreport != left.periodofreport)
50  return false;
51  return true;
52 }
53 
54 inline bool operator==(const eObrd_firmwareversion_t &right, const eObrd_firmwareversion_t &left)
55 {
56  if (right.major != left.major)
57  return false;
58  if (right.minor != left.minor)
59  return false;
60  if (right.build != left.build)
61  return false;
62 
63  return true;
64 }
65 inline bool operator!=(const eObrd_firmwareversion_t &right, const eObrd_firmwareversion_t &left)
66 {
67  return !(right == left);
68 }
69 
70 inline bool operator==(const eObrd_protocolversion_t &right, const eObrd_protocolversion_t &left)
71 {
72  if (right.major != left.major)
73  return false;
74  if (right.minor != left.minor)
75  return false;
76 
77  return true;
78 }
79 inline bool operator!=(const eObrd_protocolversion_t &right, const eObrd_protocolversion_t &left)
80 {
81  return !(right == left);
82 }
83 
84 inline bool operator==(const eObrd_canlocation_t &right, const eObrd_canlocation_t &left)
85 {
86  if (right.port != left.port)
87  return false;
88  if (right.addr != left.addr)
89  return false;
90  if (right.insideindex != left.insideindex)
91  return false;
92 
93  return true;
94 }
95 
96 inline bool operator!=(const eObrd_canlocation_t &right, const eObrd_canlocation_t &left)
97 {
98  return !(right == left);
99 }
100 
101 inline bool operator==(const eOas_ft_sensordescriptor_t &right, const eOas_ft_sensordescriptor_t &left)
102 {
103  if (right.boardinfo.type != left.boardinfo.type)
104  return false;
105  if (right.boardinfo.protocol != left.boardinfo.protocol)
106  return false;
107  if (right.boardinfo.firmware != left.boardinfo.firmware)
108  return false;
109  if (right.canloc != left.canloc)
110  return false;
111 
112  return true;
113 }
114 inline bool operator!=(const eOas_ft_sensordescriptor_t &right, const eOas_ft_sensordescriptor_t &left)
115 {
116  return !(right == left);
117 }
118 inline bool operator!=(const eOas_ft_config_t &right, const eOas_ft_config_t &left)
119 {
120  if (right.mode != left.mode)
121  return false;
122  if (right.ftperiod != left.ftperiod)
123  return false;
124  if (right.calibrationset != left.calibrationset)
125  return false;
126  if (right.temperatureperiod != left.temperatureperiod)
127  return false;
128 }
129 
130 inline bool operator==(const eOas_battery_sensordescriptor_t &right, const eOas_battery_sensordescriptor_t &left)
131 {
132  if (right.boardinfo.type != left.boardinfo.type)
133  return false;
134  if (right.boardinfo.protocol != left.boardinfo.protocol)
135  return false;
136  if (right.boardinfo.firmware != left.boardinfo.firmware)
137  return false;
138  if (right.canloc != left.canloc)
139  return false;
140 
141  return true;
142 }
143 inline bool operator!=(const eOas_battery_sensordescriptor_t &right, const eOas_battery_sensordescriptor_t &left)
144 {
145  return !(right == left);
146 }
147 
148 inline bool operator!=(const eOas_battery_config_t &right, const eOas_battery_config_t &left)
149 {
150  if (right.period != left.period)
151  return false;
152 }
virtual bool checkSettings(const Bottle &settings)
virtual bool checkPropertySensors(const Bottle &property)
virtual eObrd_type_t checkBoardType(const std::string &boardType)
virtual bool checkServiceType(const Bottle &service)
virtual bool checkPropertyCanBoards(const Bottle &bPropertiesCanBoards)
eObrd_canmonitor_cfg_t canMonitor_
virtual eObrd_type_t checkBoardType(const std::string &boardType)
virtual bool checkCanMonitor(const Bottle &service)
virtual bool checkPropertyCanBoards(const Bottle &bPropertiesCanBoards)
virtual bool checkSettings(const Bottle &settings)
virtual bool checkPropertySensors(const Bottle &property)
std::map< std::string, FtInfo > ftInfo_
virtual bool checkServiceType(const Bottle &service)
bool operator==(const eObrd_canmonitor_cfg_t &right, const eObrd_canmonitor_cfg_t &left)
Definition: testUtils.h:43
bool operator!=(const eObrd_firmwareversion_t &right, const eObrd_firmwareversion_t &left)
Definition: testUtils.h:65