Skip to content

Commit

Permalink
Test updates 2024-10-31 (#2720)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmason789 authored Nov 1, 2024
1 parent 415e305 commit b1f893e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 42 deletions.
2 changes: 1 addition & 1 deletion tst/Devices/deviceindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class DeviceIndex
DEFINE_DEVICE(SportsPlusBike, "Sports Plus Bike");
DEFINE_DEVICE(SportsTechBike, "Sports Tech Bike");
DEFINE_DEVICE(StagesBike_Assioma_PowerSensorDisabled, "Stages Bike (Assioma / Power Sensor disabled)");
DEFINE_DEVICE(StagesBike, "Stages Bike");
DEFINE_DEVICE(StagesBike, "Stages Bike");
DEFINE_DEVICE(StagesPowerBike, "Stages Power Bike");
DEFINE_DEVICE(StrydeRunTreadmill_PowerSensor, "StrydeRun Treadmill / Power Sensor");
DEFINE_DEVICE(StrydeRunTreadmill_PowerSensor2, "StrydeRun Treadmill / Power Sensor 2");
Expand Down
68 changes: 27 additions & 41 deletions tst/Devices/devicetestdataindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ void DeviceTestDataIndex::Initialize() {
"WAVEFIT-",
"KETTLERBLE",
"JAS_C3",
"SCH_190U",
"RAVE WHITE",
"DOMYOS-BIKING-",
"DU30-",
Expand All @@ -528,6 +529,9 @@ void DeviceTestDataIndex::Initialize() {
"FEIVON V2",
"FELVON V2",
"ZUMO",
"JUSTO",
"T2 ",
"VFSPINBIKE",
"XS08-",
"B94",
"STAGES BIKE",
Expand Down Expand Up @@ -1109,50 +1113,16 @@ void DeviceTestDataIndex::Initialize() {
// Stages Bike
RegisterNewDeviceTestData(DeviceIndex::StagesBike)
->expectDevice<stagesbike>()
->acceptDeviceNames({"STAGES ", "TACX SATORI", "RACER S", "ELITE TRAINER"}, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceNames({"QD","DFC"}, DeviceNameComparison::IgnoreCase)
->excluding<ftmsbike>();
->acceptDeviceNames({"STAGES ", "TACX SATORI", "RACER S", "ELITETRAINER"}, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceNames({"QD","DFC", "KU"}, DeviceNameComparison::IgnoreCase)
->excluding(stagesBikeExclusions);

// Stages Bike Stages Bike (Assioma / Power Sensor disabled
RegisterNewDeviceTestData(DeviceIndex::StagesBike_Assioma_PowerSensorDisabled)
->expectDevice<stagesbike>()
->acceptDeviceName("ASSIOMA", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::power_sensor_name, "DisabledX", "XDisabled")
->excluding( stagesBikeExclusions);

// Wahoo KICKR CORE
RegisterNewDeviceTestData(DeviceIndex::WahooKickrSnapBike_KICKRCORE)
->expectDevice<wahookickrsnapbike>()
->acceptDeviceName("KICKR CORE", DeviceNameComparison::StartsWithIgnoreCase)
->excluding(stagesBikeExclusions)
->configureSettingsWith(
[](const DeviceDiscoveryInfo& info, bool enable, std::vector<DeviceDiscoveryInfo>& configurations)->void
{
// The condition, if the name is acceptable, is:
// !deviceHasService(b, QBluetoothUuid((quint16)0x1826)) && deviceHasService(b, QBluetoothUuid((quint16)0x1818)))

if(enable) {
DeviceDiscoveryInfo result = info;
result.addBluetoothService(QBluetoothUuid((quint16)0x1818));
result.removeBluetoothService(QBluetoothUuid((quint16)0x1826));
configurations.push_back(result);
} else {
DeviceDiscoveryInfo hasNeither = info;
hasNeither.removeBluetoothService(QBluetoothUuid((quint16)0x1818));
hasNeither.removeBluetoothService(QBluetoothUuid((quint16)0x1826));

DeviceDiscoveryInfo hasInvalid = info;
hasInvalid.addBluetoothService(QBluetoothUuid((quint16)0x1826));
DeviceDiscoveryInfo hasBoth = hasInvalid;
hasBoth.addBluetoothService(QBluetoothUuid((quint16)0x1818));
hasBoth.addBluetoothService(QBluetoothUuid((quint16)0x1826));

configurations.push_back(info); // has neither
configurations.push_back(hasInvalid);
configurations.push_back(hasBoth);
}
});

->excluding(stagesBikeExclusions);

// Power (Stages) Bike
QString powerSensorName = "WattsItCalled";
Expand Down Expand Up @@ -1308,12 +1278,21 @@ void DeviceTestDataIndex::Initialize() {
->excluding(toorxAppGateUSBBikeExclusions);


// TODO: revisit, this missing a few names

// Toorx AppGate USB Bike (Enabled in settings)
RegisterNewDeviceTestData(DeviceIndex::ToorxAppGateUSBBike_EnabledInSettings)
->expectDevice<trxappgateusbbike>()
->acceptDeviceName("TOORX", DeviceNameComparison::StartsWith)
->acceptDeviceNames({"I-CONSOIE+", "I-CONSOLE+", "IBIKING+", "ICONSOLE+", "VIFHTR2.1", "DKN MOTION"}, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceNames({"I-CONSOIE+",
"I-CONSOLE+",
"IBIKING+",
"ICONSOLE+",
"VIFHTR2.1",
"REEBOK",
"DKN MOTION"}, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("CR011R", DeviceNameComparison::IgnoreCase)
->acceptDeviceNames({"CR011R", "xCR011R"}, DeviceNameComparison::StartsWithIgnoreCase) // a contains relationship
->configureSettingsWith(
[](const DeviceDiscoveryInfo &info, bool enable, std::vector<DeviceDiscoveryInfo> &configurations) -> void
{
Expand Down Expand Up @@ -1410,6 +1389,13 @@ void DeviceTestDataIndex::Initialize() {
->expectDevice<ultrasportbike>()
->acceptDeviceName("X-BIKE", DeviceNameComparison::StartsWithIgnoreCase);


// Wahoo KICKR CORE
RegisterNewDeviceTestData(DeviceIndex::WahooKickrSnapBike_KICKRCORE)
->expectDevice<wahookickrsnapbike>()
->acceptDeviceNames({"KICKR CORE" }, DeviceNameComparison::StartsWithIgnoreCase)
->excluding<ftmsbike>();

// Wahoo Kickr Snap Bike
RegisterNewDeviceTestData(DeviceIndex::WahooKickrSnapBike)
->expectDevice<wahookickrsnapbike>()
Expand All @@ -1432,12 +1418,12 @@ void DeviceTestDataIndex::Initialize() {
// Ypoo Elliptical
RegisterNewDeviceTestData(DeviceIndex::YpooElliptical)
->expectDevice<ypooelliptical>()
->acceptDeviceNames({"YPOO-U3-", "SCH_590E"}, DeviceNameComparison::StartsWithIgnoreCase);
->acceptDeviceNames({"YPOO-U3-", "SCH_590E", "KETTLER"}, DeviceNameComparison::StartsWithIgnoreCase);

// Ypoo Elliptical 2
RegisterNewDeviceTestData(DeviceIndex::YpooElliptical2)
->expectDevice<ypooelliptical>()
->acceptDeviceName("E35-", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("E35", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QBluetoothUuid((quint16)0x1826));

// Ypoo Elliptical 3
Expand Down

0 comments on commit b1f893e

Please sign in to comment.