Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LedController mbed-rtos mbed NerfUSXbee Servomotor TargetManager
Fork of NerfUS by
TESTS/ServomotorTest.cpp
- Committer:
- Maxime Dupuis
- Date:
- 2017-02-26
- Revision:
- 16:fba7c8e39388
- Child:
- 27:3ae7c62008ea
File content as of revision 16:fba7c8e39388:
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "Servomotor.hpp"
#include "MockPwmOut.hpp"
TEST(ServomotorTest, SetPositionDown)
{
MockPwmOut mock_pwm_out;
Servomotor servomotor(mock_pwm_out);
EXPECT_CALL(mock_pwm_out, pulsewidth_ms(1))
.Times(1);
servomotor.set_position_down();
}
TEST(ServomotorTest, SetPositionUp)
{
MockPwmOut mock_pwm_out;
Servomotor servomotor(mock_pwm_out);
EXPECT_CALL(mock_pwm_out, pulsewidth_ms(1.5))
.Times(1);
servomotor.set_position_up();
}
