added some tests to verify packet encoding and decoding was working properly
parent
638d6e8d5a
commit
68d6e93501
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
info source
|
||||
b main
|
||||
r
|
||||
info source
|
||||
q
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
#ifndef __P_UTIL_H__
|
||||
#define __P_UTIL_H__
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
#include "tests.h"
|
||||
#include "p_serial_packet.h"
|
||||
|
||||
void run_tests()
|
||||
{
|
||||
|
||||
// tests
|
||||
ps_packet test_pkt_send = ps_packet::test_packet_send();
|
||||
test_pkt_send.encode();
|
||||
test_pkt_send.show_packet();
|
||||
printf("\n\n");
|
||||
bool decode_ret = test_pkt_send.decode();
|
||||
printf("Decode was %s\n", decode_ret ? "Successful" : "Unsuccessful");
|
||||
test_pkt_send.show_packet();
|
||||
printf("\n\n");
|
||||
|
||||
ps_packet test_pkt_recv = ps_packet::test_packet_recv();
|
||||
bool decode_ret_recv = test_pkt_recv.decode();
|
||||
printf("Decode was %s\n", decode_ret_recv ? "Successful" : "Unsuccessful");
|
||||
test_pkt_recv.show_packet();
|
||||
printf("\n\n");
|
||||
test_pkt_recv.encode();
|
||||
test_pkt_recv.show_packet();
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef __TESTS_H__
|
||||
#define __TESTS_H__
|
||||
|
||||
void run_tests();
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue