From 6006b360d1211283165d684ea9b09a5ea63510a7 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 12 Jan 2019 22:47:05 +0900 Subject: Make protocol unit tester count test cases --- fw/protocol_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'fw') diff --git a/fw/protocol_test.c b/fw/protocol_test.c index ab824f2..d417a1b 100644 --- a/fw/protocol_test.c +++ b/fw/protocol_test.c @@ -10,7 +10,8 @@ #include "protocol.h" #include "8b10b.h" -int urandom_fd = -1; +static int urandom_fd = -1; +static long long n_tests = 0; struct test_cmd_if { struct command_if_def cmd_if; @@ -32,6 +33,7 @@ void handle_command(int command, uint8_t *args) { } void send_test_command_single(struct test_cmd_if *cmd_if, struct proto_rx_st *st, int cmd, int address, unsigned char pattern[256]) { + n_tests++; receive_symbol(st, -K28_1); receive_symbol(st, cmd); receive_symbol(st, address); @@ -40,6 +42,7 @@ void send_test_command_single(struct test_cmd_if *cmd_if, struct proto_rx_st *st } void send_test_command_bulk(struct test_cmd_if *cmd_if, struct proto_rx_st *st, int cmd, int index, int len, unsigned char pattern[256]) { + n_tests++; receive_symbol(st, -K28_1); receive_symbol(st, cmd | PKT_TYPE_BULK_FLAG); for (int j=0; j