diff --git a/cpp/devices/scsihd.cpp b/cpp/devices/scsihd.cpp index 9a8fb216..0b0cca89 100644 --- a/cpp/devices/scsihd.cpp +++ b/cpp/devices/scsihd.cpp @@ -36,9 +36,9 @@ string SCSIHD::GetProductData() const uint64_t capacity = GetBlockCount() * GetSectorSizeInBytes(); string unit; - // 10 GiB and more - if (capacity >= 1'099'511'627'776) { - capacity /= 1'099'511'627'776; + // 10,000 MiB and more + if (capacity >= 10'485'760'000) { + capacity /= 1'073'741'824; unit = "GiB"; } // 1 MiB and more diff --git a/cpp/test/scsihd_test.cpp b/cpp/test/scsihd_test.cpp index b1ff985e..179c7170 100644 --- a/cpp/test/scsihd_test.cpp +++ b/cpp/test/scsihd_test.cpp @@ -69,10 +69,10 @@ TEST(ScsiHdTest, GetProductData) hd_gb.SetFilename(string(filename)); hd_gb.SetSectorSizeInBytes(1024); - hd_gb.SetBlockCount(1'099'511'627'776 / 1024); + hd_gb.SetBlockCount(10'737'418'240 / 1024); hd_gb.FinalizeSetup(0); s = hd_gb.GetProduct(); - EXPECT_NE(string::npos, s.find("1 GiB")); + EXPECT_NE(string::npos, s.find("10 GiB")); remove(filename); }