Been writing unit tests for drive system and I believe the HomeWheel() function is causing problems when testing rover_drive_system. Ideally I want to spy on Wheel class and just return the HomeWheel() function. However that isn't working properly as I can't spy on the GetSteerAngle() as shown below.
SECTION("Spying on Wheel")
{
Mock<drive::Wheel> spy(wheel);
When(Method(spy, GetSteerAngle)).AlwaysReturn(10);
drive::Wheel & test = spy.get();
CHECK(test.GetSteerAngle() == 10);
}
Results in the following:
ERROR: CHECK( test.GetSteerAngle() == 10 ) is NOT correct! values: CHECK( 0 == 10 )
I must be doing something wrong...
Been writing unit tests for drive system and I believe the HomeWheel() function is causing problems when testing rover_drive_system. Ideally I want to spy on Wheel class and just return the HomeWheel() function. However that isn't working properly as I can't spy on the GetSteerAngle() as shown below.
Results in the following:
ERROR: CHECK( test.GetSteerAngle() == 10 ) is NOT correct! values: CHECK( 0 == 10 )
I must be doing something wrong...