diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-02-21 21:47:40 +0200 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-02-21 21:47:40 +0200 |
commit | 8cbfe79dd9ce2e8113a0f99e15d6ae4d3176b545 (patch) | |
tree | 5c819c0effca1f43ae8e06d41c10328aa1f73d5b /serial_link/tests | |
parent | 7b88b8b7e1fd50b1fc2a219c734a3069576bcbe2 (diff) |
Add master to single slave transport
Diffstat (limited to 'serial_link/tests')
-rw-r--r-- | serial_link/tests/transport_tests.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 334827507a..3fa8eab4ac 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -108,3 +108,18 @@ Ensure(Transport, writes_from_slave_to_master) { assert_that(obj2, is_not_equal_to(NULL)); assert_that(obj2->test, is_equal_to(7)); } + +Ensure(Transport, writes_from_master_to_single_slave) { + update_transport(); + test_object1_t* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_single_slave(3); + expect(router_send_frame, + when(destination, is_equal_to(4))); + update_transport(); + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_single_slave(); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(7)); +} |