Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 8, 2024
1 parent 06bcf83 commit c07cf7b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cpp/test/disk_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ TEST(DiskTest, ReadCapacity10)
disk->SetBlockCount(0x12345678);
EXPECT_NO_THROW(Dispatch(disk, scsi_command::read_capacity_10));
auto &buf = controller->GetBuffer();
EXPECT_EQ(0x1234U, GetInt16(buf, 0));
EXPECT_EQ(0x5677U, GetInt16(buf, 2));
EXPECT_EQ(0x1234, GetInt16(buf, 0));
EXPECT_EQ(0x5677, GetInt16(buf, 2));

disk->SetBlockCount(0x1234567887654321);
EXPECT_NO_THROW(Dispatch(disk, scsi_command::read_capacity_10));
buf = controller->GetBuffer();
EXPECT_EQ(0xffffU, GetInt16(buf, 0));
EXPECT_EQ(0xffffU, GetInt16(buf, 2));
EXPECT_EQ(0xffff, GetInt16(buf, 0));
EXPECT_EQ(0xffff, GetInt16(buf, 2));
}

TEST(DiskTest, ReadCapacity16)
Expand All @@ -186,12 +186,12 @@ TEST(DiskTest, ReadCapacity16)
disk->SetBlockSize(1024);
EXPECT_NO_THROW(Dispatch(disk, scsi_command::read_capacity_16_read_long_16));
const auto &buf = controller->GetBuffer();
EXPECT_EQ(0x1234U, GetInt16(buf, 0));
EXPECT_EQ(0x5678U, GetInt16(buf, 2));
EXPECT_EQ(0x8765U, GetInt16(buf, 4));
EXPECT_EQ(0x4320U, GetInt16(buf, 6));
EXPECT_EQ(0x0000U, GetInt16(buf, 8));
EXPECT_EQ(0x0400U, GetInt16(buf, 10));
EXPECT_EQ(0x1234, GetInt16(buf, 0));
EXPECT_EQ(0x5678, GetInt16(buf, 2));
EXPECT_EQ(0x8765, GetInt16(buf, 4));
EXPECT_EQ(0x4320, GetInt16(buf, 6));
EXPECT_EQ(0x0000, GetInt16(buf, 8));
EXPECT_EQ(0x0400, GetInt16(buf, 10));
}

TEST(DiskTest, ReadFormatCapacities)
Expand Down Expand Up @@ -594,9 +594,9 @@ TEST(DiskTest, Eject)
void ValidateCachingPage(AbstractController &controller, int offset)
{
const auto &buf = controller.GetBuffer();
EXPECT_EQ(0xffffU, GetInt16(buf, offset + 4)) << "Wrong pre-fetch transfer length";
EXPECT_EQ(0xffffU, GetInt16(buf, offset + 8)) << "Wrong maximum pre-fetch";
EXPECT_EQ(0xffffU, GetInt16(buf, offset + 10)) << "Wrong maximum pre-fetch ceiling";
EXPECT_EQ(0xffff, GetInt16(buf, offset + 4)) << "Wrong pre-fetch transfer length";
EXPECT_EQ(0xffff, GetInt16(buf, offset + 8)) << "Wrong maximum pre-fetch";
EXPECT_EQ(0xffff, GetInt16(buf, offset + 10)) << "Wrong maximum pre-fetch ceiling";
}

TEST(DiskTest, AddAppleVendorPage)
Expand Down

0 comments on commit c07cf7b

Please sign in to comment.