mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-21 18:17:07 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user