Do not abort but only warn on unexpected CD-ROM image size (#1084)

* Do not abort but only warn on unexpected CD-ROM image size

* Unit test update

* Updated exception handling

* Cleanup

* Fixed typo
This commit is contained in:
Uwe Seimet
2023-01-28 17:28:21 +01:00
committed by GitHub
parent 139a6ec371
commit b6941c9e81
4 changed files with 9 additions and 30 deletions
+2 -3
View File
@@ -278,7 +278,7 @@ TEST_F(PiscsiExecutorTest, Attach)
path filename = CreateTempFile(1);
SetParam(definition, "file", filename.c_str());
EXPECT_THROW(executor.Attach(context, definition, false), io_exception) << "Too small image file not rejected";
EXPECT_FALSE(executor.Attach(context, definition, false)) << "Too small image file not rejected";
remove(filename);
filename = CreateTempFile(512);
@@ -359,8 +359,7 @@ TEST_F(PiscsiExecutorTest, Insert)
path filename = CreateTempFile(1);
SetParam(definition, "file", filename.c_str());
EXPECT_THROW(executor.Insert(context, definition, device, false), io_exception)
<< "Too small image file not rejected";
EXPECT_FALSE(executor.Insert(context, definition, device, false)) << "Too small image file not rejected";
remove(filename);
filename = CreateTempFile(512);
-2
View File
@@ -95,9 +95,7 @@ TEST(ScsiCdTest, Open)
out.open(filename);
out.write(header.data(), header.size());
out.close();
resize_file(filename, 2 * 2535);
cd_raw.SetFilename(string(filename));
EXPECT_THROW(cd_raw.Open(), io_exception) << "Raw ISO CD-ROM image file size must be a multiple of 2536";
resize_file(filename, 2 * 2536);
cd_raw.Open();
EXPECT_EQ(2, cd_raw.GetBlockCount());