Fixed a potential issue with the unit test order

This commit is contained in:
Uwe Seimet 2023-03-25 19:17:13 +01:00
parent 2092b35c89
commit 5282627766
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,8 @@ TEST(PiscsiImageTest, CreateImage)
PbCommand command;
PiscsiImage image;
StorageDevice::UnreserveAll();
EXPECT_FALSE(image.CreateImage(context, command)) << "Filename must be reported as missing";
SetParam(command, "file", "/a/b/c/filename");
@ -63,6 +65,8 @@ TEST(PiscsiImageTest, DeleteImage)
PbCommand command;
PiscsiImage image;
StorageDevice::UnreserveAll();
EXPECT_FALSE(image.DeleteImage(context, command)) << "Filename must be reported as missing";
SetParam(command, "file", "/a/b/c/filename");
@ -82,6 +86,8 @@ TEST(PiscsiImageTest, RenameImage)
PbCommand command;
PiscsiImage image;
StorageDevice::UnreserveAll();
EXPECT_FALSE(image.RenameImage(context, command)) << "Source filename must be reported as missing";
SetParam(command, "from", "/a/b/c/filename_from");
@ -99,6 +105,8 @@ TEST(PiscsiImageTest, CopyImage)
PbCommand command;
PiscsiImage image;
StorageDevice::UnreserveAll();
EXPECT_FALSE(image.CopyImage(context, command)) << "Source filename must be reported as missing";
SetParam(command, "from", "/a/b/c/filename_from");
@ -116,6 +124,8 @@ TEST(PiscsiImageTest, SetImagePermissions)
PbCommand command;
PiscsiImage image;
StorageDevice::UnreserveAll();
EXPECT_FALSE(image.SetImagePermissions(context, command)) << "Filename must be reported as missing";
SetParam(command, "file", "/a/b/c/filename");