mirror of
https://github.com/tnodir/fort
synced 2024-11-14 22:05:12 +00:00
UI: Fix ConfBuffer::write() result's using
This commit is contained in:
parent
53bb7f48ad
commit
190bb5bcc0
@ -70,10 +70,10 @@ void setConf(Device &device)
|
||||
|
||||
ConfBuffer confBuf;
|
||||
|
||||
const int confIoSize = confBuf.write(conf, nullptr, envManager);
|
||||
ASSERT_NE(confIoSize, 0);
|
||||
ASSERT_TRUE(confBuf.write(conf, nullptr, envManager));
|
||||
|
||||
ASSERT_TRUE(device.ioctl(DriverCommon::ioctlSetConf(), confBuf.data(), confIoSize));
|
||||
auto confData = confBuf.buffer();
|
||||
ASSERT_TRUE(device.ioctl(DriverCommon::ioctlSetConf(), confData.data(), confData.size()));
|
||||
}
|
||||
|
||||
void printLogs(LogBuffer &buf)
|
||||
|
@ -69,10 +69,9 @@ TEST_F(ConfUtilTest, confWriteRead)
|
||||
|
||||
ConfBuffer confBuf;
|
||||
|
||||
const int confIoSize = confBuf.write(conf, nullptr, envManager);
|
||||
if (confIoSize == 0) {
|
||||
if (!confBuf.write(conf, nullptr, envManager)) {
|
||||
qCritical() << "Error:" << confBuf.errorMessage();
|
||||
ASSERT_NE(confIoSize, 0);
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
// Check the buffer
|
||||
|
@ -903,8 +903,7 @@ bool ConfManager::validateConf(const FirewallConf &newConf)
|
||||
|
||||
ConfBuffer confBuf;
|
||||
|
||||
const int confSize = confBuf.write(newConf, IoC<ConfAppManager>(), *IoC<EnvManager>());
|
||||
if (confSize == 0) {
|
||||
if (!confBuf.write(newConf, IoC<ConfAppManager>(), *IoC<EnvManager>())) {
|
||||
qCCritical(LC) << "Conf save error:" << confBuf.errorMessage();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user