Rename files to match what they actually do

Also add validator before routing.
master
Fred Sundvik 2016-02-14 13:05:50 +02:00
parent 1f1bc183dd
commit 8a991a266e
4 changed files with 11 additions and 11 deletions

View File

@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "protocol/data_link.h" #include "protocol/byte_stuffer.h"
#include "protocol/routing.h" #include "protocol/frame_validator.h"
void recv_byte(uint8_t data) { void recv_byte(uint8_t data) {
} }

View File

@ -24,29 +24,29 @@ SOFTWARE.
#include <cgreen/cgreen.h> #include <cgreen/cgreen.h>
#include <cgreen/mocks.h> #include <cgreen/mocks.h>
#include "protocol/data_link.h" #include "protocol/byte_stuffer.h"
#include "protocol/data_link.c" #include "protocol/byte_stuffer.c"
#include "protocol/routing.h" #include "protocol/frame_validator.h"
Describe(DataLink); Describe(ByteStuffer);
BeforeEach(DataLink) {} BeforeEach(ByteStuffer) {}
AfterEach(DataLink) {} AfterEach(ByteStuffer) {}
void recv_frame(uint8_t* data, uint16_t size) { void recv_frame(uint8_t* data, uint16_t size) {
mock(data, 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); never_expect(recv_frame);
recv_byte(0); 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); never_expect(recv_frame);
recv_byte(0xFF); 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); never_expect(recv_frame);
recv_byte(0x4A); recv_byte(0x4A);
} }