/usr/src/rpm/BUILD/libirobot-create-0.1/tests/led-command-test.cc File Reference

#include "common.hh"

Include dependency graph for led-command-test.cc:


Functions

int run_test (iRobot::Create &robot, std::stringstream &)

Function Documentation

int run_test ( iRobot::Create robot,
std::stringstream &   
)

00022 {
00023   using namespace iRobot;
00024 
00025   // Test Mode.
00026   CHECK_FAILURE
00027     (CommandNotAvailable,
00028      robot.sendLedCommand (Create::LED_PLAY,
00029                            Create::LED_COLOR_RED,
00030                            Create::LED_INTENSITY_OFF));
00031 
00032   // Switch to full mode and test a command.
00033   robot.sendFullCommand ();
00034   robot.sendLedCommand (Create::LED_PLAY,
00035                         Create::LED_COLOR_RED,
00036                         Create::LED_INTENSITY_OFF);
00037 
00038   // Switch to safe mode for the rest of the test.
00039   robot.sendSafeCommand ();
00040 
00041   // Send valid commands (some bounds).
00042   robot.sendLedCommand (Create::LED_NONE,
00043                         Create::LED_COLOR_RED,
00044                         Create::LED_INTENSITY_OFF);
00045   robot.sendLedCommand (Create::LED_PLAY,
00046                         Create::LED_COLOR_GREEN,
00047                         Create::LED_INTENSITY_OFF);
00048   robot.sendLedCommand (Create::LED_ADVANCE,
00049                         Create::LED_COLOR_GREEN,
00050                         Create::LED_INTENSITY_FULL);
00051   robot.sendLedCommand (Create::LED_ALL,
00052                         Create::LED_COLOR_RED,
00053                         Create::LED_INTENSITY_FULL);
00054 
00055   // Test invalid command (out of bound).
00056   Create::Led l = static_cast<Create::Led> (342);
00057 
00058   CHECK_FAILURE
00059     (InvalidArgument,
00060      robot.sendLedCommand (l,
00061                            Create::LED_COLOR_GREEN,
00062                            Create::LED_INTENSITY_OFF));
00063 
00064   return TEST_SUCCEED;
00065 }


Generated on Thu Aug 28 14:38:07 2008 for iRobot Create library by  doxygen 1.5.4