diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-02-21 21:32:01 +0200 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-02-21 21:32:01 +0200 |
commit | 7b88b8b7e1fd50b1fc2a219c734a3069576bcbe2 (patch) | |
tree | 4aa780778ee890ba964748b275ad73d9ae8d3349 /serial_link/tests/transport_tests.c | |
parent | 64b7efeb72ff67d088641bda798226e619601a43 (diff) |
Add slave to master transport
Diffstat (limited to 'serial_link/tests/transport_tests.c')
-rw-r--r-- | serial_link/tests/transport_tests.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 34d451de4d..334827507a 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -92,3 +92,19 @@ Ensure(Transport, writes_from_master_to_all_slaves) { assert_that(obj2, is_not_equal_to(NULL)); assert_that(obj2->test, is_equal_to(5)); } + +Ensure(Transport, writes_from_slave_to_master) { + update_transport(); + test_object1_t* obj = begin_write_slave_to_master(); + obj->test = 7; + expect(signal_data_written); + end_write_slave_to_master(); + expect(router_send_frame, + when(destination, is_equal_to(0))); + update_transport(); + transport_recv_frame(3, sent_data, sent_data_size); + test_object1_t* obj2 = read_slave_to_master(2); + assert_that(read_slave_to_master(0), is_equal_to(NULL)); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(7)); +} |