clean-up
This commit is contained in:
parent
52c15a7d9b
commit
9f5535721e
|
@ -5,9 +5,6 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2019
|
* @author Andrey Belomutskiy, (c) 2012-2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TEST_ION_CPP_
|
|
||||||
#define TEST_ION_CPP_
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "cdm_ion_sense.h"
|
#include "cdm_ion_sense.h"
|
||||||
|
|
||||||
|
@ -16,28 +13,22 @@ TEST(ion, signalCounter) {
|
||||||
|
|
||||||
EXPECT_EQ(0, state.getValue(0));
|
EXPECT_EQ(0, state.getValue(0));
|
||||||
|
|
||||||
state.onNewSignal(2);
|
state.onNewSignal(/* currentRevolution= */ 2);
|
||||||
state.onNewSignal(2);
|
state.onNewSignal(/* currentRevolution= */ 2);
|
||||||
state.onNewSignal(2);
|
state.onNewSignal(/* currentRevolution= */ 2);
|
||||||
|
|
||||||
// value is still '0' until we signal end of engine cycle
|
// value is still '0' until we signal end of engine cycle
|
||||||
EXPECT_EQ(0, state.getValue(2));
|
EXPECT_EQ(0, state.getValue(/* currentRevolution= */2));
|
||||||
|
|
||||||
// this invocation would flush current accumulation
|
// this invocation would flush current accumulation
|
||||||
EXPECT_EQ(3, state.getValue(3));
|
EXPECT_EQ(3, state.getValue(/* currentRevolution= */3));
|
||||||
|
|
||||||
state.onNewSignal(3);
|
state.onNewSignal(/* currentRevolution= */3);
|
||||||
// returning previous full cycle value
|
// returning previous full cycle value
|
||||||
EXPECT_EQ(3, state.getValue(3));
|
EXPECT_EQ(3, state.getValue(3));
|
||||||
|
|
||||||
|
|
||||||
EXPECT_EQ(1, state.getValue(4));
|
EXPECT_EQ(1, state.getValue(/* currentRevolution= */4));
|
||||||
EXPECT_EQ(0, state.getValue(5));
|
EXPECT_EQ(0, state.getValue(/* currentRevolution= */5));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* TEST_ION_CPP_ */
|
|
||||||
|
|
Loading…
Reference in New Issue