randomize Mock Auto device port to avoid collisions when multiple guh's are running
This commit is contained in:
parent
0614e79193
commit
853a46d788
@ -268,7 +268,9 @@ void DevicePluginMock::startMonitoringAutoDevices()
|
|||||||
DeviceDescriptor mockDescriptor(mockDeviceAutoClassId, "Mock Device (Auto created)");
|
DeviceDescriptor mockDescriptor(mockDeviceAutoClassId, "Mock Device (Auto created)");
|
||||||
|
|
||||||
ParamList params;
|
ParamList params;
|
||||||
Param param("httpport", 4242);
|
qsrand(QDateTime::currentMSecsSinceEpoch());
|
||||||
|
int port = 4242 + (qrand() % 1000);
|
||||||
|
Param param("httpport", port);
|
||||||
params.append(param);
|
params.append(param);
|
||||||
mockDescriptor.setParams(params);
|
mockDescriptor.setParams(params);
|
||||||
|
|
||||||
|
|||||||
@ -241,7 +241,6 @@ void TestDevices::getConfiguredDevices()
|
|||||||
QVariant response = injectAndWait("Devices.GetConfiguredDevices");
|
QVariant response = injectAndWait("Devices.GetConfiguredDevices");
|
||||||
|
|
||||||
QVariantList devices = response.toMap().value("params").toMap().value("devices").toList();
|
QVariantList devices = response.toMap().value("params").toMap().value("devices").toList();
|
||||||
qDebug() << "got devices" << devices;
|
|
||||||
QCOMPARE(devices.count(), 2); // There should be one auto created mock device and the one created in initTestcase()
|
QCOMPARE(devices.count(), 2); // There should be one auto created mock device and the one created in initTestcase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user