migrating to googletest

This commit is contained in:
rusefi 2019-01-14 18:56:32 -05:00
parent f0d0a9b3e4
commit 0152f9a997
3 changed files with 12 additions and 12 deletions

View File

@ -92,7 +92,7 @@ static void testExpression2(float selfValue, const char *line, float expected) {
LEElementPool pool(thepool, TEST_POOL_SIZE);
LEElement * element = pool.parseExpression(line);
print("Parsing [%s]", line);
assertTrueM("Not NULL expected", element != NULL);
ASSERT_TRUE(element != NULL) << "Not NULL expected";
LECalculator c;
EngineTestHelper eth(FORD_INLINE_6_1995);
@ -163,7 +163,7 @@ TEST(misc, testLogicExpressions) {
pool.reset();
LEElement *element;
element = pool.parseExpression("fan no_such_method");
assertTrueM("NULL expected", element == NULL);
ASSERT_TRUE(element == NULL) << "NULL expected";
/**
@ -191,7 +191,7 @@ TEST(misc, testLogicExpressions) {
LEElement thepool[TEST_POOL_SIZE];
LEElementPool pool(thepool, TEST_POOL_SIZE);
LEElement * element = pool.parseExpression("fan NOT coolant 90 > AND fan coolant 85 > AND OR");
assertTrueM("Not NULL expected", element != NULL);
ASSERT_TRUE(element != NULL) << "Not NULL expected";
LECalculator c;
ASSERT_EQ( 1, c.getValue2(0, element PASS_ENGINE_PARAMETER_SUFFIX)) << "that expression";

View File

@ -785,7 +785,7 @@ TEST(big, testFuelSchedulerBug299smallAndMedium) {
// {
// scheduling_s *ev = engine->executor.getForUnitTest(9);
// ASSERT_EQ( 5, engine->rpmCalculator.getRevolutionCounter()) << "rev cnt#4#2";
// assertTrueM("down 50", ev == &engineConfiguration->fuelActuators[2].signalPair[1].signalTimerDown);
// ASSERT_TRUE(ev == &engineConfiguration->fuelActuators[2].signalPair[1].signalTimerDown) << "down 50";
// }
@ -1073,7 +1073,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) {
engine->executor.executeAll(timeNowUs + MS2US(17.5) + 1);
// injector does not go low too soon, that's a feature :)
assertTrueM("injector@2", enginePins.injectors[0].currentLogicValue);
ASSERT_TRUE(enginePins.injectors[0].currentLogicValue) << "injector@2";
eth.fireFall(20);

View File

@ -327,7 +327,7 @@ TEST(misc, testConsoleLogic) {
ASSERT_TRUE(strEqual("echo", unquote(buffer)));
strcpy(buffer, "\"echo\"");
assertTrueM("unquote quoted", strEqual("echo", unquote(buffer)));
ASSERT_TRUE(strEqual("echo", unquote(buffer))) << "unquote quoted";
char *ptr = validateSecureLine(UNKNOWN_COMMAND);
ASSERT_EQ(0, strcmp(UNKNOWN_COMMAND, ptr));
@ -421,11 +421,11 @@ TEST(misc, testMisc) {
}
{
float v = atoff("nan");
assertTrueM("NaN atoff", cisnan(v));
ASSERT_TRUE(cisnan(v)) << "NaN atoff";
}
{
float v = atoff("N");
assertTrueM("NaN atoff", cisnan(v));
ASSERT_TRUE(cisnan(v)) << "NaN atoff";
}
// ASSERT_EQ(true, strEqual("spa3", getPinName(SPARKOUT_3_OUTPUT)));
@ -473,15 +473,15 @@ TEST(misc, testMenuTree) {
ASSERT_TRUE(tree.current == &miTopLevel4);
tree.enterSubMenu();
assertTrueM("still same", tree.current == &miTopLevel4); // no children in this one
ASSERT_TRUE(tree.current == &miTopLevel4) << "still same"; // no children in this one
tree.nextItem();
ASSERT_TRUE(tree.topVisible == &miTopLevel3);
assertTrueM("tl5", tree.current == &miTopLevel5);
ASSERT_TRUE(tree.current == &miTopLevel5) << "tl5";
tree.nextItem();
assertTrueM("tl1 t", tree.topVisible == &miTopLevel1);
assertTrueM("tl1 c", tree.current == &miTopLevel1);
ASSERT_TRUE(tree.topVisible == &miTopLevel1) << "tl1 t";
ASSERT_TRUE(tree.current == &miTopLevel1) << "tl1 c";
tree.nextItem();
tree.nextItem();