diff --git a/lambda-test/avrjunit.c b/lambda-test/avrjunit.c index 79e0c72..ce17e83 100644 --- a/lambda-test/avrjunit.c +++ b/lambda-test/avrjunit.c @@ -17,7 +17,7 @@ void beginSuite(char* const suite) { printString("\n"); char tsbuf[128]; - snprintf(tsbuf, sizeof(tsbuf),"\n", suite); printString(tsbuf); } diff --git a/lambda-test/display-test.c b/lambda-test/display-test.c index 4c68053..bc5b104 100644 --- a/lambda-test/display-test.c +++ b/lambda-test/display-test.c @@ -144,24 +144,26 @@ } /* Test "class" */ -const char display_P[] PROGMEM = "display"; +static const char class[] PROGMEM = "display"; /* Test names */ -const char testCycle_P[] PROGMEM = "testCycle"; -const char testCycleCancelAlert_P[] PROGMEM = "testCycleCancelAlert"; -const char testUpdateMeas_P[] PROGMEM = "testUpdateMeas"; -const char testResetMeas_P[] PROGMEM = "testResetMeas"; -const char testUpdateDisplayIfPending_P[] PROGMEM = "testUpdateDisplayIfPending"; -const char testUpdateDisplayIfPendingAlertActive_P[] PROGMEM = "testUpdateDisplayIfPendingAlertActive"; -const char testDisplayText_P[] PROGMEM = "testDisplayText"; +static const char testCycle_P[] PROGMEM = "testCycle"; +static const char testCycleCancelAlert_P[] PROGMEM = "testCycleCancelAlert"; +static const char testUpdateMeas_P[] PROGMEM = "testUpdateMeas"; +static const char testResetMeas_P[] PROGMEM = "testResetMeas"; +static const char testUpdateDisplayIfPending_P[] PROGMEM = "testUpdateDisplayIfPending"; +static const char testUpdateDisplayIfPendingAlertActive_P[] PROGMEM = "testUpdateDisplayIfPendingAlertActive"; +static const char testDisplayText_P[] PROGMEM = "testDisplayText"; /* Tests */ -TestCase const displayTests[] = { - {display_P, testCycle_P, testCycle}, - {display_P, testCycleCancelAlert_P, testCycleCancelAlert}, - {display_P, testUpdateMeas_P, testUpdateMeas}, - {display_P, testResetMeas_P, testResetMeas}, - {display_P, testUpdateDisplayIfPending_P, testUpdateDisplayIfPending}, - {display_P, testUpdateDisplayIfPendingAlertActive_P, testUpdateDisplayIfPendingAlertActive}, - {display_P, testDisplayText_P, testDisplayText} +static TestCase const tests[] = { + {class, testCycle_P, testCycle}, + {class, testCycleCancelAlert_P, testCycleCancelAlert}, + {class, testUpdateMeas_P, testUpdateMeas}, + {class, testResetMeas_P, testResetMeas}, + {class, testUpdateDisplayIfPending_P, testUpdateDisplayIfPending}, + {class, testUpdateDisplayIfPendingAlertActive_P, testUpdateDisplayIfPendingAlertActive}, + {class, testDisplayText_P, testDisplayText} }; + +TestClass displayClass = {tests, sizeof(tests) / sizeof(tests[0])}; diff --git a/lambda-test/integers-test.c b/lambda-test/integers-test.c index ce1a60a..6d52ebc 100644 --- a/lambda-test/integers-test.c +++ b/lambda-test/integers-test.c @@ -78,26 +78,28 @@ } /* Test "class" */ -const char integers_P[] PROGMEM = "integers"; +static const char class[] PROGMEM = "integers"; /* Test names */ -const char testDivRoundNearest_P[] PROGMEM = "testDivRoundNearest"; -const char testDivRoundNearestNumNeg_P[] PROGMEM = "testDivRoundNearestNumNeg"; -const char testDivRoundNearestDenNeg_P[] PROGMEM = "testDivRoundNearestDenNeg"; -const char testDivRoundNearestBothNeg_P[] PROGMEM = "testDivRoundNearestBothNeg"; -const char testDivRoundUp_P[] PROGMEM = "testDivRoundUp"; -const char testDivRoundUpNumNeg_P[] PROGMEM = "testDivRoundUpNumNeg"; -const char testDivRoundUpDenNeg_P[] PROGMEM = "testDivRoundUpDenNeg"; -const char testDivRoundUpBothNeg_P[] PROGMEM = "testDivRoundUpBothNeg"; +static const char testDivRoundNearest_P[] PROGMEM = "testDivRoundNearest"; +static const char testDivRoundNearestNumNeg_P[] PROGMEM = "testDivRoundNearestNumNeg"; +static const char testDivRoundNearestDenNeg_P[] PROGMEM = "testDivRoundNearestDenNeg"; +static const char testDivRoundNearestBothNeg_P[] PROGMEM = "testDivRoundNearestBothNeg"; +static const char testDivRoundUp_P[] PROGMEM = "testDivRoundUp"; +static const char testDivRoundUpNumNeg_P[] PROGMEM = "testDivRoundUpNumNeg"; +static const char testDivRoundUpDenNeg_P[] PROGMEM = "testDivRoundUpDenNeg"; +static const char testDivRoundUpBothNeg_P[] PROGMEM = "testDivRoundUpBothNeg"; /* Tests */ -TestCase const integersTests[] = { - {integers_P, testDivRoundNearest_P, testDivRoundNearest}, - {integers_P, testDivRoundNearestNumNeg_P, testDivRoundNearestNumNeg}, - {integers_P, testDivRoundNearestDenNeg_P, testDivRoundNearestDenNeg}, - {integers_P, testDivRoundNearestBothNeg_P, testDivRoundNearestBothNeg}, - {integers_P, testDivRoundUp_P, testDivRoundUp}, - {integers_P, testDivRoundUpNumNeg_P, testDivRoundUpNumNeg}, - {integers_P, testDivRoundUpDenNeg_P, testDivRoundUpDenNeg}, - {integers_P, testDivRoundUpBothNeg_P, testDivRoundUpBothNeg}, +static TestCase const tests[] = { + {class, testDivRoundNearest_P, testDivRoundNearest}, + {class, testDivRoundNearestNumNeg_P, testDivRoundNearestNumNeg}, + {class, testDivRoundNearestDenNeg_P, testDivRoundNearestDenNeg}, + {class, testDivRoundNearestBothNeg_P, testDivRoundNearestBothNeg}, + {class, testDivRoundUp_P, testDivRoundUp}, + {class, testDivRoundUpNumNeg_P, testDivRoundUpNumNeg}, + {class, testDivRoundUpDenNeg_P, testDivRoundUpDenNeg}, + {class, testDivRoundUpBothNeg_P, testDivRoundUpBothNeg}, }; + +TestClass integersClass = {tests, sizeof(tests) / sizeof(tests[0])}; diff --git a/lambda-test/interrupts-test.c b/lambda-test/interrupts-test.c index 0757731..13d257b 100644 --- a/lambda-test/interrupts-test.c +++ b/lambda-test/interrupts-test.c @@ -75,18 +75,20 @@ } /* Test "class" */ -const char interrupts_P[] PROGMEM = "interrupts"; +static const char class[] PROGMEM = "interrupts"; /* Test names */ -const char testSetupPorts_P[] PROGMEM = "testSetupPorts"; -const char testSetupSleepMode_P[] PROGMEM = "testSetupSleepMode"; -const char testInitInterrupts_P[] PROGMEM = "testInitInterrupts"; -const char testInitTimers_P[] PROGMEM = "testInitTimers"; +static const char testSetupPorts_P[] PROGMEM = "testSetupPorts"; +static const char testSetupSleepMode_P[] PROGMEM = "testSetupSleepMode"; +static const char testInitInterrupts_P[] PROGMEM = "testInitInterrupts"; +static const char testInitTimers_P[] PROGMEM = "testInitTimers"; /* Tests */ -TestCase const interruptsTests[] = { - {interrupts_P, testSetupPorts_P, testSetupPorts}, - {interrupts_P, testSetupSleepMode_P, testSetupSleepMode}, - {interrupts_P, testInitInterrupts_P, testInitInterrupts}, - {interrupts_P, testInitTimers_P, testInitTimers}, +static TestCase const tests[] = { + {class, testSetupPorts_P, testSetupPorts}, + {class, testSetupSleepMode_P, testSetupSleepMode}, + {class, testInitInterrupts_P, testInitInterrupts}, + {class, testInitTimers_P, testInitTimers}, }; + +TestClass interruptsClass = {tests, sizeof(tests) / sizeof(tests[0])}; diff --git a/lambda-test/lambda-test.c b/lambda-test/lambda-test.c index d00f41d..b0289d9 100644 --- a/lambda-test/lambda-test.c +++ b/lambda-test/lambda-test.c @@ -25,10 +25,20 @@ extern TestClass adcClass; extern TestClass commandClass; + extern TestClass displayClass; + extern TestClass integersClass; + extern TestClass interruptsClass; + extern TestClass sensorsClass; + extern TestClass stringsClass; beginSuite("lambda"); runClass(adcClass); runClass(commandClass); + runClass(displayClass); + runClass(integersClass); + runClass(interruptsClass); + runClass(sensorsClass); + runClass(stringsClass); endSuite(); return 0; diff --git a/lambda-test/sensors-test.c b/lambda-test/sensors-test.c index 49ccf51..e84cecd 100644 --- a/lambda-test/sensors-test.c +++ b/lambda-test/sensors-test.c @@ -151,42 +151,44 @@ } /* Test "class" */ -const char sensors_P[] PROGMEM = "sensors"; +static const char class[] PROGMEM = "sensors"; /* Test names */ -const char testMeasure_P[] PROGMEM = "testMeasure"; -const char testReadMeas_P[] PROGMEM = "testReadMeas"; -const char testReadMeasTooFewFields_P[] PROGMEM = "testReadMeasTooFewFields"; -const char testToLambdaValue_P[] PROGMEM = "testToLambdaValue"; -const char testToLambdaInter_P[] PROGMEM = "testToLambdaInter"; -const char testToTempI_P[] PROGMEM = "testToTempI"; -const char testToTempOValue_P[] PROGMEM = "testToTempOValue"; -const char testToTempOInter_P[] PROGMEM = "testToTempOInter"; -const char testLookupLinInterValue_P[] PROGMEM = "testLookupLinInterValue"; -const char testLookupLinInterInter_P[] PROGMEM = "testLookupLinInterInter"; -const char testLookupLinInterBelow_P[] PROGMEM = "testLookupLinInterBelow"; -const char testLookupLinInterAbove_P[] PROGMEM = "testLookupLinInterAbove"; -const char testToInfoLean_P[] PROGMEM = "testToInfoLean"; -const char testToInfoOkay_P[] PROGMEM = "testToInfoOkay"; -const char testToInfoIdeal_P[] PROGMEM = "testToInfoIdeal"; -const char testToInfoRich_P[] PROGMEM = "testToInfoRich"; +static const char testMeasure_P[] PROGMEM = "testMeasure"; +static const char testReadMeas_P[] PROGMEM = "testReadMeas"; +static const char testReadMeasTooFewFields_P[] PROGMEM = "testReadMeasTooFewFields"; +static const char testToLambdaValue_P[] PROGMEM = "testToLambdaValue"; +static const char testToLambdaInter_P[] PROGMEM = "testToLambdaInter"; +static const char testToTempI_P[] PROGMEM = "testToTempI"; +static const char testToTempOValue_P[] PROGMEM = "testToTempOValue"; +static const char testToTempOInter_P[] PROGMEM = "testToTempOInter"; +static const char testLookupLinInterValue_P[] PROGMEM = "testLookupLinInterValue"; +static const char testLookupLinInterInter_P[] PROGMEM = "testLookupLinInterInter"; +static const char testLookupLinInterBelow_P[] PROGMEM = "testLookupLinInterBelow"; +static const char testLookupLinInterAbove_P[] PROGMEM = "testLookupLinInterAbove"; +static const char testToInfoLean_P[] PROGMEM = "testToInfoLean"; +static const char testToInfoOkay_P[] PROGMEM = "testToInfoOkay"; +static const char testToInfoIdeal_P[] PROGMEM = "testToInfoIdeal"; +static const char testToInfoRich_P[] PROGMEM = "testToInfoRich"; /* Tests */ -TestCase const sensorsTests[] = { - {sensors_P, testMeasure_P, testMeasure}, - {sensors_P, testReadMeas_P, testReadMeas}, - {sensors_P, testReadMeasTooFewFields_P, testReadMeasTooFewFields}, - {sensors_P, testToLambdaValue_P, testToLambdaValue}, - {sensors_P, testToLambdaInter_P, testToLambdaInter}, - {sensors_P, testToTempI_P, testToTempI}, - {sensors_P, testToTempOValue_P, testToTempOValue}, - {sensors_P, testToTempOInter_P, testToTempOInter}, - {sensors_P, testLookupLinInterValue_P, testLookupLinInterValue}, - {sensors_P, testLookupLinInterInter_P, testLookupLinInterInter}, - {sensors_P, testLookupLinInterBelow_P, testLookupLinInterBelow}, - {sensors_P, testLookupLinInterAbove_P, testLookupLinInterAbove}, - {sensors_P, testToInfoLean_P, testToInfoLean}, - {sensors_P, testToInfoOkay_P, testToInfoOkay}, - {sensors_P, testToInfoIdeal_P, testToInfoIdeal}, - {sensors_P, testToInfoRich_P, testToInfoRich}, +static TestCase const tests[] = { + {class, testMeasure_P, testMeasure}, + {class, testReadMeas_P, testReadMeas}, + {class, testReadMeasTooFewFields_P, testReadMeasTooFewFields}, + {class, testToLambdaValue_P, testToLambdaValue}, + {class, testToLambdaInter_P, testToLambdaInter}, + {class, testToTempI_P, testToTempI}, + {class, testToTempOValue_P, testToTempOValue}, + {class, testToTempOInter_P, testToTempOInter}, + {class, testLookupLinInterValue_P, testLookupLinInterValue}, + {class, testLookupLinInterInter_P, testLookupLinInterInter}, + {class, testLookupLinInterBelow_P, testLookupLinInterBelow}, + {class, testLookupLinInterAbove_P, testLookupLinInterAbove}, + {class, testToInfoLean_P, testToInfoLean}, + {class, testToInfoOkay_P, testToInfoOkay}, + {class, testToInfoIdeal_P, testToInfoIdeal}, + {class, testToInfoRich_P, testToInfoRich}, }; + +TestClass sensorsClass = {tests, sizeof(tests) / sizeof(tests[0])}; diff --git a/lambda-test/strings-test.c b/lambda-test/strings-test.c index d5e11d7..2d94a65 100644 --- a/lambda-test/strings-test.c +++ b/lambda-test/strings-test.c @@ -38,14 +38,16 @@ } /* Test "class" */ -const char strings_P[] PROGMEM = "strings"; +static const char class[] PROGMEM = "strings"; /* Test names */ -const char testSplit_P[] PROGMEM = "testSplit"; -const char testSplitSizeTooSmall_P[] PROGMEM = "testSplitSizeTooSmall"; +static const char testSplit_P[] PROGMEM = "testSplit"; +static const char testSplitSizeTooSmall_P[] PROGMEM = "testSplitSizeTooSmall"; /* Tests */ -TestCase const stringsTests[] = { - {strings_P, testSplit_P, testSplit}, - {strings_P, testSplitSizeTooSmall_P, testSplitSizeTooSmall} +static TestCase const tests[] = { + {class, testSplit_P, testSplit}, + {class, testSplitSizeTooSmall_P, testSplitSizeTooSmall} }; + +TestClass stringsClass = {tests, sizeof(tests) / sizeof(tests[0])};