From 8a991a266e7f8f9aff48049dffb17eccfa353ca1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 13:05:50 +0200 Subject: [PATCH] Rename files to match what they actually do Also add validator before routing. --- .../protocol/{data_link.c => byte_stuffer.c} | 4 ++-- .../protocol/{data_link.h => byte_stuffer.h} | 0 .../protocol/{routing.h => frame_validator.h} | 0 ...{data_link_tests.c => byte_stuffer_tests.c} | 18 +++++++++--------- 4 files changed, 11 insertions(+), 11 deletions(-) rename serial_link/protocol/{data_link.c => byte_stuffer.c} (93%) rename serial_link/protocol/{data_link.h => byte_stuffer.h} (100%) rename serial_link/protocol/{routing.h => frame_validator.h} (100%) rename serial_link/tests/{data_link_tests.c => byte_stuffer_tests.c} (78%) diff --git a/serial_link/protocol/data_link.c b/serial_link/protocol/byte_stuffer.c similarity index 93% rename from serial_link/protocol/data_link.c rename to serial_link/protocol/byte_stuffer.c index 71d538470cf..95ce86524f1 100644 --- a/serial_link/protocol/data_link.c +++ b/serial_link/protocol/byte_stuffer.c @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "protocol/data_link.h" -#include "protocol/routing.h" +#include "protocol/byte_stuffer.h" +#include "protocol/frame_validator.h" void recv_byte(uint8_t data) { } diff --git a/serial_link/protocol/data_link.h b/serial_link/protocol/byte_stuffer.h similarity index 100% rename from serial_link/protocol/data_link.h rename to serial_link/protocol/byte_stuffer.h diff --git a/serial_link/protocol/routing.h b/serial_link/protocol/frame_validator.h similarity index 100% rename from serial_link/protocol/routing.h rename to serial_link/protocol/frame_validator.h diff --git a/serial_link/tests/data_link_tests.c b/serial_link/tests/byte_stuffer_tests.c similarity index 78% rename from serial_link/tests/data_link_tests.c rename to serial_link/tests/byte_stuffer_tests.c index 1b7107e708f..418d48f6a4e 100644 --- a/serial_link/tests/data_link_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -24,29 +24,29 @@ SOFTWARE. #include #include -#include "protocol/data_link.h" -#include "protocol/data_link.c" -#include "protocol/routing.h" +#include "protocol/byte_stuffer.h" +#include "protocol/byte_stuffer.c" +#include "protocol/frame_validator.h" -Describe(DataLink); -BeforeEach(DataLink) {} -AfterEach(DataLink) {} +Describe(ByteStuffer); +BeforeEach(ByteStuffer) {} +AfterEach(ByteStuffer) {} void recv_frame(uint8_t* data, uint16_t size) { mock(data, size); } -Ensure(DataLink, receives_no_frame_for_a_single_zero_byte) { +Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { never_expect(recv_frame); recv_byte(0); } -Ensure(DataLink, receives_no_frame_for_a_single_FF_byte) { +Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { never_expect(recv_frame); recv_byte(0xFF); } -Ensure(DataLink, receives_no_frame_for_a_single_random_byte) { +Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { never_expect(recv_frame); recv_byte(0x4A); }