From 05181cd837cf0b1cb0dc47dc1e73ced85a026deb Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 14 Jan 2019 17:44:03 -0500 Subject: [PATCH] migrating to googletest --- unit_tests/tests/test_pid_auto.cpp | 4 ++-- unit_tests/tests/test_signal_executor.cpp | 2 +- unit_tests/unit_test_framework.h | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/unit_tests/tests/test_pid_auto.cpp b/unit_tests/tests/test_pid_auto.cpp index b7b2c56738..d86acb96ec 100644 --- a/unit_tests/tests/test_pid_auto.cpp +++ b/unit_tests/tests/test_pid_auto.cpp @@ -151,7 +151,7 @@ static void testPidAutoZigZagGrowingOsc() { at.input = zigZagValue(mockTimeMs); bool result = at.Runtime(&logging); - assertTrueM("should be true#2", result); + ASSERT_TRUE(result) << "should be true#2"; assertEqualsM("FAiled", FAILED, at.state); assertEqualsM("output Growing", 0.0, at.output); @@ -210,7 +210,7 @@ TEST(pidAutoTune, delayLine) { if (result) printf("*** Converged! Got result: P=%f I=%f D=%f\r\n", at.GetKp(), at.GetKi(), at.GetKd()); - assertTrueM("should be true#5", result); + ASSERT_TRUE(result) << "should be true#5"; } TEST(misc, testPidAuto) { diff --git a/unit_tests/tests/test_signal_executor.cpp b/unit_tests/tests/test_signal_executor.cpp index 5811430a61..a5355f9a55 100644 --- a/unit_tests/tests/test_signal_executor.cpp +++ b/unit_tests/tests/test_signal_executor.cpp @@ -70,7 +70,7 @@ static void orderCallback(void *a) { long value = (long)a; printf("value=%d prevValue=%d\r\n", value, prevValue); - assertTrueM("orderCallback", value > prevValue); + ASSERT_TRUE(value > prevValue) << "orderCallback"; prevValue = value; } diff --git a/unit_tests/unit_test_framework.h b/unit_tests/unit_test_framework.h index 05ca73ef3f..b3f2dbe298 100644 --- a/unit_tests/unit_test_framework.h +++ b/unit_tests/unit_test_framework.h @@ -18,9 +18,7 @@ void assertEqualsLM(const char *msg, long expected, long actual); void assertEqualsM4(const char *prefix, const char *msg, float expected, float actual); void assertEqualsM5(const char *prefix, const char *message, float expected, float actual, float EPS); void assertEquals(float expected, float actual); -void assertTrue(float actual); void assertTrueM(const char *msg, float actual); -void assertFalse(float actual); void assertFalseM(const char *msg, float actual); #endif /* UNIT_TEST_FRAMEWORK_H_ */