Skip to content

Commit

Permalink
Moved rainGauge objects to TESTs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Aug 15, 2023
1 parent a0de6da commit 1084984
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions test/src/TestRainGauge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,142 +73,103 @@ static void setTime(const char *time, tm &tm, time_t &ts)
}

TEST_GROUP(TestRainGaugeHour) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeHourShortInterval) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeHourLongInterval) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeHourExtremeInterval) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeDaily) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeWeekly) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeMonthly) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeHourOv) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeHourOvMidnight) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeDailyOv) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeWeeklyOv) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeMonthlyOv) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
}
};

TEST_GROUP(TestRainGaugeStartup) {
static RainGauge rainGauge;

void setup() {
rainGauge.reset();
}

void teardown() {
Expand All @@ -219,6 +180,9 @@ TEST_GROUP(TestRainGaugeStartup) {
* Test rainfall during past hour (no rain gauge overflow)
*/
TEST(TestRainGaugeHour, Test_RainHour) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -296,6 +260,9 @@ TEST(TestRainGaugeHour, Test_RainHour) {
* short update interval (5 minutes)
*/
TEST(TestRainGaugeHourShortInterval, Test_RainHourShort) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -385,6 +352,9 @@ TEST(TestRainGaugeHourShortInterval, Test_RainHourShort) {
* The ring buffer will not be filled completely.
*/
TEST(TestRainGaugeHourLongInterval, Test_RainHourLong) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -459,6 +429,9 @@ TEST(TestRainGaugeHourLongInterval, Test_RainHourLong) {
* The distance between head and tail will be > 1h.
*/
TEST(TestRainGaugeHourExtremeInterval, Test_RainHourExtreme) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -506,6 +479,9 @@ TEST(TestRainGaugeHourExtremeInterval, Test_RainHourExtreme) {
* Test daily rainfall (no rain gauge overflow)
*/
TEST(TestRainGaugeDaily, Test_RainDaily) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -548,6 +524,9 @@ TEST(TestRainGaugeDaily, Test_RainDaily) {
* Test weekly rainfall (no rain gauge overflow)
*/
TEST(TestRainGaugeWeekly, Test_RainWeekly) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -603,6 +582,9 @@ TEST(TestRainGaugeWeekly, Test_RainWeekly) {
* Test monthly rainfall (no rain gauge overflow)
*/
TEST(TestRainGaugeMonthly, Test_RainMonthly) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor = 0;
Expand Down Expand Up @@ -727,6 +709,9 @@ TEST(TestRainGaugeMonthly, Test_RainMonthly) {
* Test rainfall during past hour (with rain gauge overflow)
*/
TEST(TestRainGaugeHourOv, Test_RainHourOv) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;

Expand Down Expand Up @@ -804,6 +789,9 @@ TEST(TestRainGaugeHourOv, Test_RainHourOv) {
* timestamps across Midnight
*/
TEST(TestRainGaugeHourOvMidnight, Test_RainHourOvMidnight) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;

Expand Down Expand Up @@ -886,6 +874,9 @@ TEST(TestRainGaugeHourOvMidnight, Test_RainHourOvMidnight) {
* Test daily rainfall (with rain gauge overflow)
*/
TEST(TestRainGaugeDailyOv, Test_RainDailyOv) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -930,6 +921,9 @@ TEST(TestRainGaugeDailyOv, Test_RainDailyOv) {
* Test weekly rainfall (with rain gauge overflow)
*/
TEST(TestRainGaugeWeeklyOv, Test_RainWeeklyOv) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down Expand Up @@ -986,6 +980,9 @@ TEST(TestRainGaugeWeeklyOv, Test_RainWeeklyOv) {
* Test monthly rainfall (no rain gauge overflow)
*/
TEST(TestRainGaugeMonthlyOv, Test_RainMonthlyOv) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor = 0;
Expand Down Expand Up @@ -1112,6 +1109,9 @@ TEST(TestRainGaugeMonthlyOv, Test_RainMonthlyOv) {
* i.e. sensor reset or battery change
*/
TEST(TestRainGaugeStartup, TestRainStartup) {
static RainGauge rainGauge;
rainGauge.reset();

tm tm;
time_t ts;
float rainSensor;
Expand Down

0 comments on commit 1084984

Please sign in to comment.