Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Oct 20, 2024
1 parent d6fc38e commit 9970acf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion cpp/test/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,10 @@ class MockTape : public Tape

public:

using Tape::Tape;
MockTape() : Tape(0)
{
}
~MockTape() override = default;

void SetReady(bool b)
{
Expand Down
10 changes: 5 additions & 5 deletions cpp/test/tape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
pair<shared_ptr<MockAbstractController>, shared_ptr<MockTape>> CreateTape()
{
auto controller = make_shared<NiceMock<MockAbstractController>>(0);
auto tape = make_shared<MockTape>(0);
auto tape = make_shared<MockTape>();
EXPECT_TRUE(tape->Init( { }));
EXPECT_TRUE(controller->AddDevice(tape));

Expand Down Expand Up @@ -81,7 +81,7 @@ TEST(TapeTest, Inquiry)

TEST(TapeTest, ValidateFile)
{
MockTape tape(0);
MockTape tape;

EXPECT_THROW(tape.ValidateFile(), io_exception)<< "Invalid block count";

Expand All @@ -106,7 +106,7 @@ TEST(TapeTest, Open)

TEST(TapeTest, Unload)
{
MockTape tape(0);
MockTape tape;

tape.SetReady(true);
EXPECT_TRUE(tape.Eject(false));
Expand Down Expand Up @@ -326,7 +326,7 @@ TEST(TapeTest, FormatMedium)

TEST(TapeTest, GetBlockSizes)
{
MockTape tape(0);
MockTape tape;

const auto &sizes = tape.GetSupportedBlockSizes();
EXPECT_EQ(5U, sizes.size());
Expand All @@ -341,7 +341,7 @@ TEST(TapeTest, GetBlockSizes)
TEST(TapeTest, SetUpModePages)
{
map<int, vector<byte>> pages;
MockTape tape(0);
MockTape tape;

// Non changeable
tape.SetUpModePages(pages, 0x3f, false);
Expand Down

0 comments on commit 9970acf

Please sign in to comment.