Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 12, 2023
1 parent a4f4303 commit 7be4eec
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cpp/test/abstract_controller_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@

using namespace scsi_defs;

TEST(AbstractControllerTest, ShutdownMode)
{
MockAbstractController controller;

EXPECT_EQ(AbstractController::shutdown_mode::NONE, controller.GetShutdownMode());
controller.ScheduleShutdown(AbstractController::shutdown_mode::RESTART_PI);
EXPECT_EQ(AbstractController::shutdown_mode::RESTART_PI, controller.GetShutdownMode());
controller.ScheduleShutdown(AbstractController::shutdown_mode::STOP_S2P);
EXPECT_EQ(AbstractController::shutdown_mode::STOP_S2P, controller.GetShutdownMode());
controller.ScheduleShutdown(AbstractController::shutdown_mode::STOP_PI);
EXPECT_EQ(AbstractController::shutdown_mode::STOP_PI, controller.GetShutdownMode());
controller.ScheduleShutdown(AbstractController::shutdown_mode::RESTART_PI);
EXPECT_EQ(AbstractController::shutdown_mode::RESTART_PI, controller.GetShutdownMode());
}

TEST(AbstractControllerTest, AllocateCmd)
{
MockAbstractController controller;
Expand Down

0 comments on commit 7be4eec

Please sign in to comment.