7 #include "board/board_unit_tester.h"
9 const int rxpin = Board::kPinTie1a;
10 const int txpin = Board::kPinTie1b;
20 static void setUp(
void) {
25 static void tearDown(
void) {
31 static void test_BasicRxTx(
void) {
34 TEST_ASSERT_EQUAL_INT(letter, sut->
Get());
37 static void test_RxcheckWithNothingInBuffer(
void) {
41 static void test_BasicRxCheckTx(
void) {
44 waitcnt(CLKFREQ / 100 + CNT);
45 TEST_ASSERT_EQUAL_INT(letter, sut->
Get(
TIMEOUT));
48 static void test_PutGetMultipleBytes(
void) {
49 for (
char letter =
'a'; letter <=
'z'; letter++) {
51 waitcnt(CLKFREQ / 100 + CNT);
52 TEST_ASSERT_EQUAL_INT(letter, sut->
Get());
56 static void test_RxflushClearsBuffer(
void) {
60 waitcnt(CLKFREQ / 100 + CNT);
63 waitcnt(CLKFREQ / 100 + CNT);
69 static void test_PutLongString(
void) {
70 char string [] =
"Hello, World! I'm a Propeller. What are you?";
71 int length = strlen(
string);
73 waitcnt(CLKFREQ / 100 + CNT);
75 for (
int i = 0; i < length; i++) {
76 TEST_ASSERT_EQUAL_INT(
string[i], sut->
Get(
TIMEOUT));
83 static void test_PutEmptyString(
void) {
86 waitcnt(CLKFREQ / 100 + CNT);