unit tests to write MS logs #7222

only:making tests a bit more real
This commit is contained in:
rusefillc 2024-12-27 20:07:08 -05:00
parent 25f1010279
commit f8e920ceaa
7 changed files with 1 additions and 15 deletions

View File

@ -148,4 +148,5 @@ void CsvReader::readLine(EngineTestHelper *eth) {
if (!haveMore())
return;
processLine(eth);
engine->periodicSlowCallback();
}

View File

@ -16,8 +16,6 @@ TEST(harley, crankingSomethingCam) {
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
// whole pattern is a copy-paste from test_real_4b11.cpp, is better API possible?
auto rpm = Sensor::getOrZero(SensorType::Rpm);
if (!gotRpm && rpm) {

View File

@ -21,8 +21,6 @@ TEST(real4b11, running) {
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
// Expect that all teeth are in the correct spot
float angleError = getTriggerCentral()->triggerToothAngleError;
EXPECT_TRUE(angleError < 3 && angleError > -3) << "tooth angle of " << angleError << " at timestamp " << (getTimeNowNt() / 1e8);
@ -57,8 +55,6 @@ TEST(real4b11, runningDoubledEdge) {
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
auto rpm = Sensor::getOrZero(SensorType::Rpm);
if (!gotRpm && rpm) {
gotRpm = true;

View File

@ -13,8 +13,6 @@ TEST(realBQS, realHarleyCranking) {
bool gotRpm = false;
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
auto rpm = Sensor::getOrZero(SensorType::Rpm);
if (gotRpm) {
@ -45,7 +43,6 @@ TEST(realBQS, readAsPrimarySensor) {
bool gotRpm = false;
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
auto rpm = Sensor::getOrZero(SensorType::Rpm);
if (!gotRpm && rpm) {

View File

@ -28,8 +28,6 @@ TEST(realCas24Plus1, spinningOnBench) {
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
// Expect that all teeth are in the correct spot
float angleError = getTriggerCentral()->triggerToothAngleError;
EXPECT_TRUE(angleError < 3 && angleError > -3) << "tooth angle of " << angleError << " at timestamp " << (getTimeNowNt() / 1e8);

View File

@ -17,8 +17,6 @@ TEST(crankingGm24x_5, gmRealCrankingFromFile) {
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
// Expect that all teeth are in the correct spot
float angleError = getTriggerCentral()->triggerToothAngleError;
EXPECT_TRUE(angleError < 3 && angleError > -3) << "tooth angle of " << angleError << " at timestamp " << (getTimeNowNt() / 1e8);

View File

@ -14,8 +14,6 @@ static void doTest(const char* testFile, int expectedRpm) {
while (reader.haveMore()) {
reader.processLine(&eth);
engine->periodicSlowCallback();
}
ASSERT_EQ(0, eth.recentWarnings()->getCount())<< "warningCounter#vwRealCranking";