-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWordclockTests.cpp
More file actions
97 lines (91 loc) · 4.59 KB
/
Copy pathWordclockTests.cpp
File metadata and controls
97 lines (91 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/******************************************************************************************************************************************************
* FILE DESCRIPTION
* -------------------------------------------------------------------------------------------------------------------------------------------------*/
/** \file WordclockTests.cpp
* \brief Runs the regression tests for the firmware core, in the order they need
*
* \details The cases themselves live in cases/, one file per subject, the way
* platform/esp32/test/cases/ is laid out. One binary rather than one per
* file, though: that side went to five executables and had to build an
* object cache to stop compiling the core five times a run, and there is
* no reason to buy the same problem here.
*
* Nothing here needs a display: the pixel buffer lives in Pixels and the
* window that renders it is a separate PixelsFrame, which is never
* constructed.
*
* The order below is not arbitrary. testDisplayManagerLatch() runs first,
* because the latch it checks is only unlatched before the first task, and
* the two persistence cases run last, because they leave settings behind
* and write to the real store in the working directory.
*
******************************************************************************************************************************************************/
/******************************************************************************************************************************************************
* I N C L U D E S
******************************************************************************************************************************************************/
#include <cstdlib>
#include <iostream>
#include "cases.h"
#include "check.h"
/******************************************************************************************************************************************************
* M A I N
******************************************************************************************************************************************************/
int main()
{
testDisplayManagerLatch();
testShowNowProcedures();
testTemperatureOverlayWithoutSensor();
testEveryAnimationEndsOnTheNewTime();
testFlickerLeavesTheDisplayOn();
testFadeDimsAndComesBack();
testCharacterToGlyphMapping();
testUndrawableCharacterShiftsAsASpace();
testReadingPastTheEndIsEmpty();
testWritingPastTheEndIsRefused();
testGlyphAccessorsCheckBothWays();
testRegionalWordings();
testOverlayPeriodAndEndurance();
testSchedulerSpeedRoundTrip();
testUptimeCountsWithoutWrapping();
testWordsChangeOnFiveMinuteStepsOnly();
testInvalidTimeIsRejected();
testClockModes();
testClockModeStepsThroughEveryWording();
testClockWordsComparison();
testAnimationStepsThroughEveryOne();
testDisplayOffAndOnAgain();
testDisplayToggleFollowsTheState();
testBrightnessTogglesInvertTheSetting();
testColourChangesReachTheStrip();
testPixelColorChannels();
testDisplayCharacterLookup();
testNightWindowIncludesMidnight();
testNightSwitchDimsWithoutLosingTheSetting();
testNightSwitchActsOnTheCrossingOnly();
testNightWithNoBrightnessCutsTheSupply();
testDisplaySwitchedOnAtNightGetsItsSupplyBack();
testColourCycleLeavesTheChosenColourAlone();
testColourCycleWalksTheWholeWheel();
testColourCycleStandsStillOnADarkDisplay();
testColourCycleBudgetsTheColourItShows();
testSupplyCutWaitsForTheBlankedFrame();
testSupplyReturnsBeforeTheDataLine();
testSupplyOffIsNotDisplayDisable();
testSupplyRequestsAreReversible();
testAutomaticDefaultsSuitARoom();
testAutomaticSpreadsBetweenBothBounds();
testCurrentLimitFitsTheBudgetAtEveryLitCount();
testCurrentLimitFollowsTheColour();
testCurrentLimitLeavesTheRestoredFaceAlone();
testCurrentLimitDoesNotSwitchTheDisplayOn();
testPersistence();
testPersistenceSaveAndReset();
if(Failures == 0) {
std::cout << "All Wordclock tests passed.\n";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
/******************************************************************************************************************************************************
* E N D O F F I L E
******************************************************************************************************************************************************/