@@ -207,26 +207,51 @@ TEST_F (EmcyTest, NMTErrorBehavior)
207
207
EXPECT_EQ (0u , result);
208
208
EXPECT_EQ (0u , value);
209
209
210
- co_emcy_tx (&net, 1 , 0x1234 , msef);
210
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
211
211
EXPECT_EQ (STATE_INIT, net.state );
212
212
213
- net.state = STATE_LAST;
214
- co_emcy_tx (&net, 1 , 0x1234 , msef);
215
- EXPECT_EQ (STATE_LAST, net.state );
216
-
217
213
net.state = STATE_OFF;
218
- co_emcy_tx (&net, 1 , 0x1234 , msef);
214
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
219
215
EXPECT_EQ (STATE_OFF, net.state );
220
216
221
217
net.state = STATE_STOP;
222
- co_emcy_tx (&net, 1 , 0x1234 , msef);
218
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
223
219
EXPECT_EQ (STATE_STOP, net.state );
224
220
225
221
net.state = STATE_OP;
226
- co_emcy_tx (&net, 1 , 0x1234 , msef);
222
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
223
+ EXPECT_EQ (STATE_PREOP, net.state );
224
+
225
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
227
226
EXPECT_EQ (STATE_PREOP, net.state );
228
227
228
+ net.state = STATE_OP;
229
229
co_emcy_tx (&net, 1 , 0x1234 , msef);
230
+ EXPECT_EQ (STATE_OP, net.state );
231
+
232
+ value = 1 ;
233
+ result = co_od1029_fn (&net, OD_EVENT_WRITE, obj1029, NULL , 1 , &value);
234
+ EXPECT_EQ (0u , result);
235
+ EXPECT_EQ (1 , net.error_behavior );
236
+
237
+ net.state = STATE_INIT;
238
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
239
+ EXPECT_EQ (STATE_INIT, net.state );
240
+
241
+ net.state = STATE_OFF;
242
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
243
+ EXPECT_EQ (STATE_OFF, net.state );
244
+
245
+ net.state = STATE_STOP;
246
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
247
+ EXPECT_EQ (STATE_STOP, net.state );
248
+
249
+ net.state = STATE_OP;
250
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
251
+ EXPECT_EQ (STATE_OP, net.state );
252
+
253
+ net.state = STATE_PREOP;
254
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
230
255
EXPECT_EQ (STATE_PREOP, net.state );
231
256
232
257
value = 2 ;
@@ -235,27 +260,31 @@ TEST_F (EmcyTest, NMTErrorBehavior)
235
260
EXPECT_EQ (2 , net.error_behavior );
236
261
237
262
net.state = STATE_INIT;
238
- co_emcy_tx (&net, 1 , 0x1234 , msef);
263
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
239
264
EXPECT_EQ (STATE_INIT, net.state );
240
265
241
266
net.state = STATE_OFF;
242
- co_emcy_tx (&net, 1 , 0x1234 , msef);
267
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
243
268
EXPECT_EQ (STATE_OFF, net.state );
244
269
245
270
net.state = STATE_STOP;
246
- co_emcy_tx (&net, 1 , 0x1234 , msef);
271
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
247
272
EXPECT_EQ (STATE_STOP, net.state );
248
273
249
274
net.state = STATE_OP;
250
- co_emcy_tx (&net, 1 , 0x1234 , msef);
275
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
251
276
EXPECT_EQ (STATE_STOP, net.state );
252
277
253
278
net.state = STATE_PREOP;
254
- co_emcy_tx (&net, 1 , 0x1234 , msef);
279
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
255
280
EXPECT_EQ (STATE_STOP, net.state );
256
281
257
- co_emcy_tx (&net, 1 , 0x1234 , msef);
282
+ co_emcy_tx (&net, 0x8130 , 0x1234 , msef);
258
283
EXPECT_EQ (STATE_STOP, net.state );
284
+
285
+ net.state = STATE_OP;
286
+ co_emcy_tx (&net, 1 , 0x1234 , msef);
287
+ EXPECT_EQ (STATE_OP, net.state );
259
288
}
260
289
261
290
TEST_F (EmcyTest, EmcyOverrun)
0 commit comments