mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-24 14:31:51 +00:00
Fixed a potential issue with the unit test order (reserved file cleanup was missing) (#1137)
* Fixed a potential issue with the unit test order * Updated error handling
This commit is contained in:
parent
8987ce30cd
commit
07e953fa77
@ -87,7 +87,7 @@ bool GPIOBUS_Raspberry::Init(mode_e mode)
|
|||||||
// Map peripheral region memory
|
// Map peripheral region memory
|
||||||
void *map = mmap(NULL, 0x1000100, PROT_READ | PROT_WRITE, MAP_SHARED, fd, baseaddr);
|
void *map = mmap(NULL, 0x1000100, PROT_READ | PROT_WRITE, MAP_SHARED, fd, baseaddr);
|
||||||
if (map == MAP_FAILED) {
|
if (map == MAP_FAILED) {
|
||||||
LOGERROR("Error: Unable to map memory")
|
LOGERROR("Error: Unable to map memory: %s", strerror(errno))
|
||||||
close(fd);
|
close(fd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -985,4 +985,4 @@ uint32_t GPIOBUS_Raspberry::Acquire()
|
|||||||
#endif // SIGNAL_CONTROL_MODE
|
#endif // SIGNAL_CONTROL_MODE
|
||||||
|
|
||||||
return signals;
|
return signals;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,8 @@ TEST(PiscsiImageTest, CreateImage)
|
|||||||
PbCommand command;
|
PbCommand command;
|
||||||
PiscsiImage image;
|
PiscsiImage image;
|
||||||
|
|
||||||
|
StorageDevice::UnreserveAll();
|
||||||
|
|
||||||
EXPECT_FALSE(image.CreateImage(context, command)) << "Filename must be reported as missing";
|
EXPECT_FALSE(image.CreateImage(context, command)) << "Filename must be reported as missing";
|
||||||
|
|
||||||
SetParam(command, "file", "/a/b/c/filename");
|
SetParam(command, "file", "/a/b/c/filename");
|
||||||
@ -63,6 +65,8 @@ TEST(PiscsiImageTest, DeleteImage)
|
|||||||
PbCommand command;
|
PbCommand command;
|
||||||
PiscsiImage image;
|
PiscsiImage image;
|
||||||
|
|
||||||
|
StorageDevice::UnreserveAll();
|
||||||
|
|
||||||
EXPECT_FALSE(image.DeleteImage(context, command)) << "Filename must be reported as missing";
|
EXPECT_FALSE(image.DeleteImage(context, command)) << "Filename must be reported as missing";
|
||||||
|
|
||||||
SetParam(command, "file", "/a/b/c/filename");
|
SetParam(command, "file", "/a/b/c/filename");
|
||||||
@ -82,6 +86,8 @@ TEST(PiscsiImageTest, RenameImage)
|
|||||||
PbCommand command;
|
PbCommand command;
|
||||||
PiscsiImage image;
|
PiscsiImage image;
|
||||||
|
|
||||||
|
StorageDevice::UnreserveAll();
|
||||||
|
|
||||||
EXPECT_FALSE(image.RenameImage(context, command)) << "Source filename must be reported as missing";
|
EXPECT_FALSE(image.RenameImage(context, command)) << "Source filename must be reported as missing";
|
||||||
|
|
||||||
SetParam(command, "from", "/a/b/c/filename_from");
|
SetParam(command, "from", "/a/b/c/filename_from");
|
||||||
@ -99,6 +105,8 @@ TEST(PiscsiImageTest, CopyImage)
|
|||||||
PbCommand command;
|
PbCommand command;
|
||||||
PiscsiImage image;
|
PiscsiImage image;
|
||||||
|
|
||||||
|
StorageDevice::UnreserveAll();
|
||||||
|
|
||||||
EXPECT_FALSE(image.CopyImage(context, command)) << "Source filename must be reported as missing";
|
EXPECT_FALSE(image.CopyImage(context, command)) << "Source filename must be reported as missing";
|
||||||
|
|
||||||
SetParam(command, "from", "/a/b/c/filename_from");
|
SetParam(command, "from", "/a/b/c/filename_from");
|
||||||
@ -116,6 +124,8 @@ TEST(PiscsiImageTest, SetImagePermissions)
|
|||||||
PbCommand command;
|
PbCommand command;
|
||||||
PiscsiImage image;
|
PiscsiImage image;
|
||||||
|
|
||||||
|
StorageDevice::UnreserveAll();
|
||||||
|
|
||||||
EXPECT_FALSE(image.SetImagePermissions(context, command)) << "Filename must be reported as missing";
|
EXPECT_FALSE(image.SetImagePermissions(context, command)) << "Filename must be reported as missing";
|
||||||
|
|
||||||
SetParam(command, "file", "/a/b/c/filename");
|
SetParam(command, "file", "/a/b/c/filename");
|
||||||
|
Loading…
Reference in New Issue
Block a user