diff --git a/lambda-test/Makefile b/lambda-test/Makefile index 7f70182..1fc122f 100644 --- a/lambda-test/Makefile +++ b/lambda-test/Makefile @@ -15,8 +15,8 @@ ## If you've split your program into multiple .c / .h files, ## include the additional source (in same directory) here LOCAL_SOURCE = avrjunit.c adc-test.c alert-test.c command-test.c \ -display-test.c integers-test.c interrupts-test.c rules-test.c sensors-test.c \ -strings-test.c usart-test.c +display-test.c integers-test.c interrupts-test.c release-test.c \ +rules-test.c sensors-test.c strings-test.c usart-test.c ## Here you can link to one more directory (and multiple .c files) EXTRA_SOURCE_DIR = ../lambda/ diff --git a/lambda-test/lambda-test.c b/lambda-test/lambda-test.c index e47a3e6..864e5c5 100644 --- a/lambda-test/lambda-test.c +++ b/lambda-test/lambda-test.c @@ -23,6 +23,7 @@ int main(void) { initUSART(); + extern TestClass releaseClass; extern TestClass adcClass; extern TestClass alertClass; extern TestClass commandClass; @@ -35,6 +36,7 @@ extern TestClass usartClass; beginSuite("lambda"); + runClass(releaseClass); runClass(adcClass); runClass(alertClass); runClass(commandClass); diff --git a/lambda-test/release-test.c b/lambda-test/release-test.c new file mode 100644 index 0000000..b93e8b4 --- /dev/null +++ b/lambda-test/release-test.c @@ -0,0 +1,54 @@ +/* + * release-test.c + * + * Unit tests for the lambda project. + * + * Created on: 15.05.2015 + * Author: dode@luniks.net + * + */ + +#include "avrjunit.h" +#include "interrupts.h" +#include "messages.h" +#include "pins.h" +#include "sensors.h" + +/* Validate release */ + +/** + * TODO Makefile, improve this, how? + */ +static bool testRelease(void) { + // language set to en + assertTrue(0 == LANG); + + // pins according to diagram + assertTrue(PD7 == LCD_RS); + assertTrue(PD6 == LCD_EN); + assertTrue(PD5 == LCD_DB4); + assertTrue(PD4 == LCD_DB5); + assertTrue(PD3 == LCD_DB6); + assertTrue(PD2 == LCD_DB7); + + // average value + assertTrue(61 == INTS_PER_SEC); + + // nominal value + assertTrue(100 == SHUNT_MILLIOHMS); + + return true; +} + +/* Test "class" */ +static const char class[] PROGMEM = "release"; + +/* Test names */ +static const char testRelease_P[] PROGMEM = "testRelease"; + +/* Tests */ +static TestCase const tests[] = { + {class, testRelease_P, testRelease} +}; + +TestClass releaseClass = {tests, sizeof(tests) / sizeof(tests[0])};