Slightly more mock preparation, but most likely not going to finish it

This commit is contained in:
Mark van Renswoude 2016-09-29 21:14:42 +02:00
parent f7081f3917
commit 6ebfb984ee
4 changed files with 26 additions and 9 deletions

View File

@ -1,4 +1,5 @@
#include <cxxtest/TestSuite.h>
#include "Mock.h"
#include "lib/SegmentDisplay.h"
class SegmentDisplayTestSuite : public CxxTest::TestSuite
@ -11,10 +12,21 @@ class SegmentDisplayTestSuite : public CxxTest::TestSuite
display->end();
}
/*
void testWriteNumberFull(void)
{
SegmentDisplay* display = new SegmentDisplay();
display->begin();
display->setDigits(8);
display->writeNumber(12345678);
display->end();
// TODO test writing the full 8-digit numbers
TS_WARN("Not implemented");
}
void testWriteTextFull(void)
@ -46,4 +58,5 @@ class SegmentDisplayTestSuite : public CxxTest::TestSuite
// TODO test writing text which is too long
TS_WARN("Not implemented");
}
*/
};

View File

@ -24,8 +24,8 @@ static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
void digitalWrite( uint32_t dwPin, uint32_t dwVal );
void pinMode( uint32_t dwPin, uint32_t dwMode );
void digitalWrite(uint32_t dwPin, uint32_t dwVal);
void pinMode(uint32_t dwPin, uint32_t dwMode);
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
#endif

View File

@ -1,19 +1,19 @@
// Provides hookable implementations for the mock headers
// Provides implementations for the mock headers that write out to a vector.
// Access this vector using Mock.h.
#include "Arduino.h"
#include "Mock.h"
void digitalWrite( uint32_t dwPin, uint32_t dwVal )
void digitalWrite(uint32_t dwPin, uint32_t dwVal)
{
}
void pinMode( uint32_t dwPin, uint32_t dwMode )
void pinMode(uint32_t dwPin, uint32_t dwMode)
{
}
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
}

4
test/mock/Mock.h Normal file
View File

@ -0,0 +1,4 @@
#ifndef Mock_h
#define Mock_h
#endif