Skip to content

Commit

Permalink
Added interface unit test placeholder.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Dec 21, 2018
1 parent 84e3696 commit 7eeb69e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/Arduino.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ HardwareSerial::HardwareSerial(void) {
void HardwareSerial::reset(void) {
rx = 0;
tx = 0;
rxBuf = "";
txBuf = "";
}

/*
Expand All @@ -30,6 +32,12 @@ String HardwareSerial::readStringUntil(char) {
return "xxx";
}

byte HardwareSerial::read(void) {
rx++;

return 0x00;
}

size_t HardwareSerial::write(byte *, size_t size) {
tx += size;

Expand All @@ -48,5 +56,9 @@ size_t HardwareSerial::write(string s) {
return s.length();
}

bool HardwareSerial::available(void) {
return true;
}


HardwareSerial Serial;
4 changes: 4 additions & 0 deletions tests/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ class HardwareSerial {
void reset(void),
readBytes(char *buf, size_t size);
String readStringUntil(char);
byte read(void);
size_t write(byte *, size_t),
write(char),
write(string);
bool available(void);
size_t rx,
tx;
string rxBuf,
txBuf;
};


Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EXEC := run_tests
MAIN := test_lib
TESTS := test_print test_rpcCall test_signature test_tuple
TESTS := test_interface test_print test_rpcCall test_signature test_tuple
FIXTURES := Arduino


Expand Down
10 changes: 10 additions & 0 deletions tests/test_interface.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <catch.hpp>

#include "../simpleRPC/interface.tcc"


TEST_CASE("Describe function", "[describe]") {
void (*f)(void);

//REQUIRE(_describe(f, "") == ":;");
}

0 comments on commit 7eeb69e

Please sign in to comment.