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
Diff: TESTS/ServomotorTest.cpp
- Revision:
- 16:fba7c8e39388
- Child:
- 27:3ae7c62008ea
diff -r 6b4455e85450 -r fba7c8e39388 TESTS/ServomotorTest.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TESTS/ServomotorTest.cpp Sun Feb 26 10:20:18 2017 -0500
@@ -0,0 +1,28 @@
+#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();
+}
+
