Memory management update, SonarCloud fixes, fix for issue #841 (#842)

- Memory management updates, more fixed Sonar issues
* Replaced macros, fixed other sonar issues
* Added const, replaced enum with a single value by constant
* Updated object initializations
* Fixed potential strncpy overflow reported by gcc 8.3
This commit is contained in:
Uwe Seimet
2022-09-15 23:01:10 +02:00
committed by GitHub
parent e64c2f7254
commit 241e739d3a
51 changed files with 533 additions and 712 deletions

View File

@@ -15,7 +15,7 @@ TEST(ControllerManagerTest, ControllerManager)
const int ID = 4;
const int LUN = 6;
auto device = static_cast<PrimaryDevice *>(device_factory.CreateDevice(UNDEFINED, "services", ID));
auto device = device_factory.CreateDevice(UNDEFINED, "services", ID);
device->SetId(ID);
device->SetLun(LUN);
@@ -27,7 +27,8 @@ TEST(ControllerManagerTest, ControllerManager)
EXPECT_EQ(device, controller_manager.GetDeviceByIdAndLun(ID, LUN));
EXPECT_EQ(nullptr, controller_manager.GetDeviceByIdAndLun(0, 0));
controller_manager.DeleteAllControllersAndDevices();
controller_manager.DeleteAllControllers();
device_factory.DeleteAllDevices();
EXPECT_EQ(nullptr, controller_manager.FindController(ID));
EXPECT_EQ(nullptr, controller_manager.GetDeviceByIdAndLun(ID, LUN));
}