summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-06-23 02:13:52 -0700
committerKeith Packard <keithp@keithp.com>2012-06-23 02:13:52 -0700
commit83549f8bde42c3fddbdc817540c869dc8aefd013 (patch)
treef72a6ddc89fca6a0cee57553ff1d4e2f9c2bac0e
parentf7bf07dfdad260c1f219064957ef08fb480bf20f (diff)
altos: Make ao_fec_tx_test build cleanly with -Wall
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/test/Makefile2
-rw-r--r--src/test/ao_fec_tx_test.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/test/Makefile b/src/test/Makefile
index 024a54c1..7bcf24e1 100644
--- a/src/test/Makefile
+++ b/src/test/Makefile
@@ -4,7 +4,7 @@ PROGS=ao_flight_test ao_flight_test_baro ao_flight_test_accel ao_flight_test_noi
KALMAN=make-kalman
-CFLAGS=-I.. -I. -I../core -I../drivers -O0 -g
+CFLAGS=-I.. -I. -I../core -I../drivers -O0 -g -Wall
all: $(PROGS)
diff --git a/src/test/ao_fec_tx_test.c b/src/test/ao_fec_tx_test.c
index d01eadc5..1b1fd56d 100644
--- a/src/test/ao_fec_tx_test.c
+++ b/src/test/ao_fec_tx_test.c
@@ -77,7 +77,6 @@ ao_encode(uint8_t *input, int input_len, uint8_t *output)
{
uint8_t prepare[PREPARE_LEN(input_len)];
uint8_t encode[ENCODE_LEN(input_len)];
- uint8_t interleave[INTERLEAVE_LEN(input_len)];
uint8_t prepare_len;
uint8_t encode_len;
uint8_t interleave_len;
@@ -159,6 +158,7 @@ ao_decode(uint8_t *bytes, int bytes_len, uint8_t *bits)
bits_len = ao_fec_decode(bytes, bytes_len, bits);
ao_fec_dump_bytes(bits, bits_len, "Decode");
+ return bits_len;
}
int
@@ -182,9 +182,11 @@ main(int argc, char **argv)
transmit_len = ao_radio(encode, encode_len, transmit);
/* apply gaussian noise to test viterbi code against errors */
- receive_len = ao_fuzz(transmit, transmit_len, receive, 0x80);
+ receive_len = ao_fuzz(transmit, transmit_len, receive, 0x70);
decode_len = ao_decode(receive, receive_len, decode);
+
+ return decode_len >= sizeof(original);
}