diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-02-21 17:33:31 +0200 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-02-21 17:33:31 +0200 |
commit | 679bfe7c5452f69a790e648c7661bbbdb12ce4ae (patch) | |
tree | a97ddfd39ebac3644654b1a0f0fa319749078a1a /serial_link/tests/transport_tests.c | |
parent | 4ee6eadf9e88b89f017c3c06e2d376cf953f6a42 (diff) |
More transport WIP
Diffstat (limited to 'serial_link/tests/transport_tests.c')
-rw-r--r-- | serial_link/tests/transport_tests.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index f9f5b47737..31e7b2dc7e 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -34,32 +34,21 @@ typedef struct { uint32_t test2; } test_object2_t; -MASTER_REMOTE_OBJECT(0, test_object1_t); -SLAVE_REMOTE_OBJECT(1, test_object1_t); -MASTER_REMOTE_OBJECT(2, test_object2_t); -SLAVE_REMOTE_OBJECT(3, test_object2_t); - -// We want -// master -> slave = 1 local(target all), 1 remote object -// slave -> master = 1 local(target 0), multiple remote objects -// master -> single slave (multiple local, target id), 1 remote object - -remote_object_t* remote_objects[] = { - REMOTE_OBJECT(0), - REMOTE_OBJECT(1), - REMOTE_OBJECT(2), - REMOTE_OBJECT(3), +MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t); +MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t); +SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); + +remote_object_t* test_remote_objects[] = { + REMOTE_OBJECT(master_to_slave), + REMOTE_OBJECT(master_to_single_slave), + REMOTE_OBJECT(slave_to_master), }; Describe(Transport); BeforeEach(Transport) { - init_transport(); + init_transport(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t)); } AfterEach(Transport) {} -Ensure(Transport, packet_number_is_sequential) { - assert_that(transport_send_frame(0, NULL, 0), is_equal_to(1)); - assert_that(transport_send_frame(0, NULL, 0), is_equal_to(2)); - // It doesn't matter if the destination changes - assert_that(transport_send_frame(1, NULL, 0), is_equal_to(3)); +Ensure(Transport, write_to_local_signals_an_event) { } |