#include "irobot-create.hh"#include <sstream>#include "config.h"


Go to the source code of this file.
Defines | |
| #define | GENERATE_TEST() |
| #define | CHECK_FAILURE(EXCEPTION, CMD) |
| #define | CHECK_SENSOR_CHAR(PACKET, DATA, CONDITION) |
| #define | CHECK_SENSOR_UCHAR(PACKET, DATA, CONDITION) CHECK_SENSOR_CHAR (PACKET, DATA, CONDITION) |
| #define CHECK_FAILURE | ( | EXCEPTION, | |||
| CMD | ) |
Value:
{ \
bool failed = true; \
try \
{ \
CMD; \
} \
catch (EXCEPTION&) \
{ \
failed = false; \
} \
catch (...) \
{} \
if (failed) \
return TEST_FAILED; \
}
| #define CHECK_SENSOR_CHAR | ( | PACKET, | |||
| DATA, | |||||
| CONDITION | ) |
Value:
robot.sendSensorsCommand (PACKET); \ stream.seekg (stream.tellp ()); \ stream.put (DATA); \ if (CONDITION) \ return TEST_FAILED
| #define CHECK_SENSOR_UCHAR | ( | PACKET, | |||
| DATA, | |||||
| CONDITION | ) | CHECK_SENSOR_CHAR (PACKET, DATA, CONDITION) |
| #define GENERATE_TEST | ( | ) |
Value:
int \ main (int argc, char** argv) \ { \ if (argc == 2 \ && std::string (argv[1]) == "--version") \ { \ std::cout << PACKAGE_STRING << std::endl; \ return 0; \ } \ \ std::stringstream stream; \ int status = 0; \ try \ { \ iRobot::Create robot (stream); \ status = run_test (robot, stream); \ } \ catch (std::runtime_error& e) \ { \ std::cerr << e.what () << std::endl; \ return 1; \ } \ catch (...) \ { \ std::cerr << "Unexpected error" << std::endl; \ return 2; \ } \ std::cout << stream.str (); \ return status; \ }
1.5.4