Skip to content
Tommy Ngo edited this page Aug 28, 2014 · 12 revisions

The following are gtest unit test suites that are currently implented. All tests must pass before any changes are commited to a branch.

###TestDiceRoller.cpp

The DiceRoller class represents a rolling dice with n sides and a threshold that sets itself to n at DiceRoller instantiation. When the dice is rolled, if result >= threshold, the threshold resets to n. If result < threshold, the threshold is decremented.

The test suite checks that the threshold is properly set when the following events occur:

  • DiceRoller instantiation
  • roll() after threshold is already at 1 (guaranteed meeting of the threshold)
  • After each roll() while looping through several hundred roll() calls (general case)

###TestChefRobot.cpp

The ChefRobot is responsible for cooking food at the stove. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node.

The test suite checks the above functionality by testing for:

  • ChefRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestCompanionshipRobot.cpp

The CompanionshipRobot is responsible for providing companionship to a Point of Interest node, in this case, the Resident. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node.

The test suite checks the above functionality by testing for:

  • CompanionshipRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestCompanionshipRobot.cpp

The CompanionshipRobot is responsible for providing companionship to a Point of Interest node, in this case, the Resident. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node.

The test suite checks the above functionality by testing for:

  • CompanionshipRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestEscortRobot.cpp

The EscortRobot is responsible for providing escorting services to a Robot, in this case, the Resident. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node. In addition, on completion of tasks, the EscortRobot should publish the appropriate success message.

The test suite checks the above functionality by testing for:

  • EscortRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestEntertainmentRobot.cpp

The EntertainmentRobot is responsible for providing entertainment to a Point of Interest node, in this case, the Resident. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node. In addition, on completion of tasks, the EntertainmentRobot should publish the appropriate success message.

The test suite checks the above functionality by testing for:

  • EntertainmentRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestRelativeRobot.cpp

The RelativeRobot is responsible for providing visitation services to a Point of Interest node, in this case, the Resident. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node. In addition, on completion of tasks, the RelativeRobot should publish the appropriate success message.

The test suite checks the above functionality by testing for:

  • RelativeRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestMedicationRobot.cpp

The MedicationRobot is responsible for providing scheduled medication to a Point of Interest node, in this case, the Resident. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node. In addition, on completion of tasks, the MedicationRobot should publish the appropriate success message.

The test suite checks the above functionality by testing for:

  • MedicationRobot instantiation
  • Successful interpretation of an event message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestCaregiverRobot.cpp

The Caregiver is responsible for providing scheduled exercise, shower, conversation and moral support assistance to a Point of Interest node, in this case, the Resident. Specifically for the shower event, the Caregiver robot will go to the Resident robot, exchange service to transfer a common Point of Interest node (i.e. shower position) to the Resident and then it will escort the Resident to the that POI. A primary functionality of this robot is to successfully parse, execute and respond to tasks as indicated by the central Scheduler node. In addition, on completion of tasks, the Caregiver should publish the appropriate success message.

The test suite checks the above functionality by testing for:

  • Caregiver instantiation
  • Successful interpretation a variety of events message delivered via event_trigger
  • Successful delivery of a response message indicating the task was performed as required

###TestScheduler.cpp The scheduler is responsible for issuing scheduled tasks and manage concurrency of events for each individual robots, it can also accept external tasks such as random events and events injected from the GUI. It also have ability to deny external events and toggle looping between day and night after the queue is empty.

The test suite checks the above functionality by testing for:

  • EventTriggerCallback receiving correct messages type
  • ExternalEventCallback receiving and enqueueing events properly
  • Only accepting MORAL_SUPPORT, ILL and VERY_ILL once per day
  • Accept all other events multiple time per day
  • EAT event gets injected properly after COOK

###TestPathServer.cpp The PathServer is responsible for providing paths between points. In addition to the unit tests, some tests for PathServer have been described in the manual testing page - if a robot gets stuck or hits a wall the PathServer is broken.

The test suite also checks that the robot heads in the right direction and ends in the right location. The test suits also checks that an appropriate response is given when the find_path service is utilized.

###TestResident.cpp The resident is responsible for providing a service through which helper robots can "provide help". When a task is performed on the resident, it should either accept it, tell the helper to wait, or indicate the helper can go away. The resident makes decisions about appropriate responses based on its current task and the incoming task's priority.

The test suite checks the above functionality by testing for:

  • PerformTask service generating correct responses when requested with various combinations of tasks
  • Ensuring ILL and VERY_ILL tasks will override any other tasks being accepted
Clone this wiki locally