2 #ifndef testMacrosINDI_hpp
3 #define testMacrosINDI_hpp
10 #define XWCTEST_INDI_CALLBACK_VALIDATION
21 #define XWCTEST_MAKE_INDI_PROP( stub, \
26 #define XWCTEST_SETUP_INDI_NEW_PROP( propname ) \
27 XWCTEST_MAKE_INDI_PROP(m_indiP_, propname).setDevice(m_configName); \
28 XWCTEST_MAKE_INDI_PROP(m_indiP_, propname).setName(#propname);
30 #define XWCTEST_SETUP_INDI_ARB_NEW_PROP(varname, propname) \
31 varname.setDevice(m_configName); \
32 varname.setName(#propname);
34 #define XWCTEST_SETUP_INDI_ARB_PROP( varname, device, propname ) \
35 varname.setDevice(#device); \
36 varname.setName(#propname);
38 #define XWCTEST_MAKE_INDI_CALLBACK( stub, callback) stub ## callback
47 #define XWCTEST_INDI_NEW_CALLBACK( testclass, \
50 GIVEN("A New Callback for " # propname ) \
52 WHEN("Wrong Device") \
54 testclass ## _test sdgt("right"); \
55 pcf::IndiProperty ip; \
56 ip.setDevice("wrong"); \
57 ip.setName( #propname ); \
58 int rv = sdgt.XWCTEST_MAKE_INDI_CALLBACK(newCallBack_m_indiP_,propname)(ip); \
63 testclass ## _test sdgt("right"); \
64 pcf::IndiProperty ip; \
65 ip.setDevice("right"); \
66 ip.setName("wrong"); \
67 int rv = sdgt.XWCTEST_MAKE_INDI_CALLBACK(newCallBack_m_indiP_,propname)(ip); \
70 WHEN("Right Device.Name") \
72 testclass ## _test sdgt("right"); \
73 pcf::IndiProperty ip; \
74 ip.setDevice("right"); \
75 ip.setName( #propname ); \
76 int rv = sdgt.XWCTEST_MAKE_INDI_CALLBACK(newCallBack_m_indiP_,propname)(ip); \
90 #define XWCTEST_INDI_SET_CALLBACK( testclass, \
95 GIVEN("A Set Callback for " # propname ) \
97 WHEN("Wrong Device") \
99 testclass ## _test sdgt("right"); \
100 pcf::IndiProperty ip; \
101 ip.setDevice("wrong"); \
102 ip.setName( #propname ); \
103 int rv = sdgt.XWCTEST_MAKE_INDI_CALLBACK(setCallBack_,varname)(ip); \
108 testclass ## _test sdgt("right"); \
109 pcf::IndiProperty ip; \
110 ip.setDevice(#device); \
111 ip.setName("wrong"); \
112 int rv = sdgt.XWCTEST_MAKE_INDI_CALLBACK(setCallBack_,varname)(ip); \
115 WHEN("Right Device.Name") \
117 testclass ## _test sdgt("right"); \
118 pcf::IndiProperty ip; \
119 ip.setDevice(#device); \
120 ip.setName( #propname ); \
121 int rv = sdgt.XWCTEST_MAKE_INDI_CALLBACK(setCallBack_,varname)(ip); \
136 #define XWCTEST_INDI_ARBNEW_CALLBACK( testclass, \
140 GIVEN("A Callback for " # propname ) \
142 WHEN("Wrong Device") \
144 testclass ## _test sdgt("right"); \
145 pcf::IndiProperty ip; \
146 ip.setDevice("wrong"); \
147 ip.setName( #propname ); \
148 int rv = sdgt. callback (ip); \
153 testclass ## _test sdgt("right"); \
154 pcf::IndiProperty ip; \
155 ip.setDevice("right"); \
156 ip.setName("wrong" #propname ); \
157 int rv = sdgt. callback (ip); \
160 WHEN("Right Device.Name") \
162 testclass ## _test sdgt("right"); \
163 pcf::IndiProperty ip; \
164 ip.setDevice("right"); \
165 ip.setName( #propname ); \
166 int rv = sdgt. callback (ip); \