mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
2 Commits
b24ceb27f5
...
0972d3373f
Author | SHA1 | Date |
---|---|---|
|
0972d3373f | |
|
9a106c4af4 |
|
@ -46,14 +46,13 @@ T GetHistory(const HistoryData<T> &history, uint period, uint age)
|
||||||
TEST_CASE("History Rotation and Reporting tests")
|
TEST_CASE("History Rotation and Reporting tests")
|
||||||
{
|
{
|
||||||
HistoryData<uint16_t> history{};
|
HistoryData<uint16_t> history{};
|
||||||
ValidHistoryMask valid_history = 0;
|
uint64_t valid_history = 0;
|
||||||
|
|
||||||
/* Fill the history with decreasing data points for 24 years of history. This ensures that no data period should
|
/* Fill the history with decreasing data points for 24 years of history. This ensures that no data period should
|
||||||
* contain the same value as another period. */
|
* contain the same value as another period. */
|
||||||
uint16_t i = 12 * HISTORY_PERIODS;
|
uint16_t i = 12 * HISTORY_PERIODS;
|
||||||
for (uint date = 1; date <= 12 * HISTORY_PERIODS; ++date, --i) {
|
for (uint date = 1; date <= 12 * HISTORY_PERIODS; ++date, --i) {
|
||||||
history[THIS_MONTH] = i;
|
history[THIS_MONTH] = i;
|
||||||
UpdateValidHistory(valid_history, date % 12);
|
|
||||||
RotateHistory(history, valid_history, date % 12);
|
RotateHistory(history, valid_history, date % 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue