gui: Options, Scheduler, Speed Limiter, Batch, Grabber, and the tray icon
Continues the build order past the Add-URL/File-Info/Progress dialog flow.
- OptionsDialog: General/Save To/Connection/Downloads/Proxy/Sounds tabs, every
control bound to a real settings.* key (contracts/schema/types/Settings.
schema.json). The spec's File Types and Site Logins tabs have no settings.*
backing (categories go through category.upsert, credentials through the
Secret Service) so they don't exist here — a tab either binds to a real key
or isn't shipped. diffChanged() sends only what actually changed, matching
settings.set's "changed[] names exactly what took effect" contract.
- SchedulerDialog: per-queue schedule (schedule.get/set) plus maxConcurrent/
onComplete (queue.upsert), Start Now/Stop. Queue.schema.json already carries
the schedule so queue.list alone seeds the window.
- SpeedLimiterDialog: the live global limiter (limiter.get/set) — a different
thing from Options' downloads.speedLimit* default. buildParams() enforces
the schema's "0 with enabled true must not be offered".
- BatchDialog: clipboard-blob and {start..end}-wildcard tabs sharing one
category/queue/start-mode footer into download.addBatch.
- GrabberWizard: 4-step QWizard (project label -> start URL/depth/filters ->
file-type filter -> review), grabber.start feeding a poll+event.grabber.
progress-driven review page, Finish = grabber.harvest for the checked files.
- TrayIcon: active-count tooltip, Show/Add URL/Pause All/Resume All/Speed
Limiter submenu/Quit. Quit only closes the GUI — there is no RPC to stop
veloxd itself, filed as a new gap in daemon-requests-m1.md. MainWindow now
also hides to tray instead of closing when general.minimizeToTray is set.
Every dialog's non-widget logic (diffChanged, buildSchedule, buildParams,
parseUrlBlob/expandWildcard/buildAddBatchParams, buildFileTypes/
buildStartParams/buildHarvestParams) is a static pure function with its own
test, same shape as FileInfoDialog::buildSpec from the previous round.
Verified end-to-end against a running mockd under ASan+UBSan: all five
surfaces render real data (settings.get values, queue.list's two seeded
queues, limiter.get, a live grabber.start/status crawl returning 3 files) with
no sanitizer reports. gui-check (non-ASan) and dev (ASan+UBSan) presets both
build the whole repo clean; all gui-labeled ctest targets pass.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSCdCWFXBTSBBK3MzWtJiC
This commit is contained in:
@@ -82,6 +82,68 @@ set_tests_properties(gui_fileinfodialog PROPERTIES
|
||||
LABELS "gui"
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
|
||||
|
||||
# tst_optionsdialog — OptionsDialog::diffChanged, the "only send what changed" logic.
|
||||
# Red when an unchanged key gets resent, or a key missing from `original` stops
|
||||
# counting as changed.
|
||||
add_executable(tst_optionsdialog tst_optionsdialog.cpp)
|
||||
target_compile_features(tst_optionsdialog PRIVATE cxx_std_23)
|
||||
target_compile_options(tst_optionsdialog PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(tst_optionsdialog PRIVATE velox-gui-lib Qt6::Widgets Qt6::Test)
|
||||
add_test(NAME gui_optionsdialog COMMAND tst_optionsdialog)
|
||||
set_tests_properties(gui_optionsdialog PROPERTIES
|
||||
LABELS "gui"
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
|
||||
|
||||
# tst_speedlimiterdialog — SpeedLimiterDialog::buildParams.
|
||||
# Red when disabling stops zeroing globalBps, or enabling at 0 KiB/s stops being
|
||||
# clamped to 1 (Limiter.schema.json: enabled+0 "must not be offered").
|
||||
add_executable(tst_speedlimiterdialog tst_speedlimiterdialog.cpp)
|
||||
target_compile_features(tst_speedlimiterdialog PRIVATE cxx_std_23)
|
||||
target_compile_options(tst_speedlimiterdialog PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(tst_speedlimiterdialog PRIVATE velox-gui-lib Qt6::Widgets Qt6::Test)
|
||||
add_test(NAME gui_speedlimiterdialog COMMAND tst_speedlimiterdialog)
|
||||
set_tests_properties(gui_speedlimiterdialog PROPERTIES
|
||||
LABELS "gui"
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
|
||||
|
||||
# tst_schedulerdialog — SchedulerDialog::buildSchedule.
|
||||
# Red when "use a schedule" unchecked stops sending JSON null, "run until it drains"
|
||||
# stops nulling stopTime, or daysOfWeek/onceDate leak into the wrong mode.
|
||||
add_executable(tst_schedulerdialog tst_schedulerdialog.cpp)
|
||||
target_compile_features(tst_schedulerdialog PRIVATE cxx_std_23)
|
||||
target_compile_options(tst_schedulerdialog PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(tst_schedulerdialog PRIVATE velox-gui-lib Qt6::Widgets Qt6::Test)
|
||||
add_test(NAME gui_schedulerdialog COMMAND tst_schedulerdialog)
|
||||
set_tests_properties(gui_schedulerdialog PROPERTIES
|
||||
LABELS "gui"
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
|
||||
|
||||
# tst_batchdialog — parseUrlBlob, expandWildcard, buildAddBatchParams.
|
||||
# Red when the clipboard parser stops deduping or lets a non-URL line through, the
|
||||
# wildcard expander mishandles zero-padding or an ambiguous/malformed range, or
|
||||
# addBatch params include an empty optional field or a stray queueId.
|
||||
add_executable(tst_batchdialog tst_batchdialog.cpp)
|
||||
target_compile_features(tst_batchdialog PRIVATE cxx_std_23)
|
||||
target_compile_options(tst_batchdialog PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(tst_batchdialog PRIVATE velox-gui-lib Qt6::Widgets Qt6::Test)
|
||||
add_test(NAME gui_batchdialog COMMAND tst_batchdialog)
|
||||
set_tests_properties(gui_batchdialog PROPERTIES
|
||||
LABELS "gui"
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
|
||||
|
||||
# tst_grabberwizard — buildFileTypes, buildStartParams, buildHarvestParams.
|
||||
# Red when every file-type box unchecked stops meaning "every type" (null, not []),
|
||||
# a blank filter stops becoming schema null, or a selected fileId goes missing from
|
||||
# the harvest params.
|
||||
add_executable(tst_grabberwizard tst_grabberwizard.cpp)
|
||||
target_compile_features(tst_grabberwizard PRIVATE cxx_std_23)
|
||||
target_compile_options(tst_grabberwizard PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(tst_grabberwizard PRIVATE velox-gui-lib Qt6::Widgets Qt6::Test)
|
||||
add_test(NAME gui_grabberwizard COMMAND tst_grabberwizard)
|
||||
set_tests_properties(gui_grabberwizard PROPERTIES
|
||||
LABELS "gui"
|
||||
ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
|
||||
|
||||
# gui_no_download_logic — CLAUDE.md §3 as an executable check, not a hope.
|
||||
# Red when: a download-logic token (curl, raw pwrite, sqlite, QSqlDatabase) appears
|
||||
# under gui/src. grep exits 0 only when it finds a match, so a hit fails the test.
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
// BatchDialog unit tests: parseUrlBlob, expandWildcard, buildAddBatchParams. Lane GUI.
|
||||
//
|
||||
// Red when the clipboard parser stops deduping or starts letting non-URL lines through,
|
||||
// the wildcard expander mishandles zero-padding or a malformed/ambiguous range, or the
|
||||
// addBatch params start including an empty optional field or leak queueId into a
|
||||
// non-"queue" startMode.
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
#include "dialogs/BatchDialog.hpp"
|
||||
|
||||
using velox::gui::BatchDialog;
|
||||
|
||||
class TstBatchDialog : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void parseUrlBlobDedupesAndFiltersNonUrls();
|
||||
void parseUrlBlobTrimsAndSkipsBlankLines();
|
||||
void expandWildcardSimpleRange();
|
||||
void expandWildcardZeroPadded();
|
||||
void expandWildcardNoRangeReturnsPatternIfUrl();
|
||||
void expandWildcardMalformedRangeIsEmpty();
|
||||
void expandWildcardAmbiguousMultiRangeIsEmpty();
|
||||
void buildAddBatchParamsOmitsEmptyOptionalFields();
|
||||
void buildAddBatchParamsQueueIdOnlyForQueueMode();
|
||||
};
|
||||
|
||||
void TstBatchDialog::parseUrlBlobDedupesAndFiltersNonUrls() {
|
||||
const QString text =
|
||||
"https://example.test/a\nnot a url\nhttps://example.test/a\nhttps://example.test/b";
|
||||
const QStringList urls = BatchDialog::parseUrlBlob(text);
|
||||
QCOMPARE(urls, QStringList({"https://example.test/a", "https://example.test/b"}));
|
||||
}
|
||||
|
||||
void TstBatchDialog::parseUrlBlobTrimsAndSkipsBlankLines() {
|
||||
const QString text = " https://example.test/a \n\n\n \n";
|
||||
QCOMPARE(BatchDialog::parseUrlBlob(text), QStringList({"https://example.test/a"}));
|
||||
}
|
||||
|
||||
void TstBatchDialog::expandWildcardSimpleRange() {
|
||||
const QStringList urls = BatchDialog::expandWildcard("https://example.test/img{1..3}.jpg");
|
||||
QCOMPARE(urls, QStringList({"https://example.test/img1.jpg", "https://example.test/img2.jpg",
|
||||
"https://example.test/img3.jpg"}));
|
||||
}
|
||||
|
||||
void TstBatchDialog::expandWildcardZeroPadded() {
|
||||
const QStringList urls = BatchDialog::expandWildcard("https://example.test/img{08..10}.jpg");
|
||||
QCOMPARE(urls, QStringList({"https://example.test/img08.jpg", "https://example.test/img09.jpg",
|
||||
"https://example.test/img10.jpg"}));
|
||||
}
|
||||
|
||||
void TstBatchDialog::expandWildcardNoRangeReturnsPatternIfUrl() {
|
||||
QCOMPARE(BatchDialog::expandWildcard("https://example.test/a.jpg"),
|
||||
QStringList({"https://example.test/a.jpg"}));
|
||||
QVERIFY(BatchDialog::expandWildcard("not a url").isEmpty());
|
||||
}
|
||||
|
||||
void TstBatchDialog::expandWildcardMalformedRangeIsEmpty() {
|
||||
QVERIFY(BatchDialog::expandWildcard("https://example.test/img{5..1}.jpg").isEmpty());
|
||||
}
|
||||
|
||||
void TstBatchDialog::expandWildcardAmbiguousMultiRangeIsEmpty() {
|
||||
QVERIFY(BatchDialog::expandWildcard("https://example.test/{1..2}/img{1..3}.jpg").isEmpty());
|
||||
}
|
||||
|
||||
void TstBatchDialog::buildAddBatchParamsOmitsEmptyOptionalFields() {
|
||||
const QJsonObject params =
|
||||
BatchDialog::buildAddBatchParams({"https://example.test/a"}, QString(), QString(), "now");
|
||||
const QJsonObject defaults = params.value("defaults").toObject();
|
||||
QVERIFY(!defaults.contains("categoryId"));
|
||||
QVERIFY(!defaults.contains("queueId"));
|
||||
QCOMPARE(params.value("items").toArray().size(), 1);
|
||||
}
|
||||
|
||||
void TstBatchDialog::buildAddBatchParamsQueueIdOnlyForQueueMode() {
|
||||
const QJsonObject queued =
|
||||
BatchDialog::buildAddBatchParams({"https://example.test/a"}, QString(), "q1", "queue");
|
||||
QCOMPARE(queued.value("defaults").toObject().value("queueId").toString(), QStringLiteral("q1"));
|
||||
|
||||
const QJsonObject notQueued =
|
||||
BatchDialog::buildAddBatchParams({"https://example.test/a"}, QString(), "q1", "now");
|
||||
QVERIFY(!notQueued.value("defaults").toObject().contains("queueId"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TstBatchDialog)
|
||||
#include "tst_batchdialog.moc"
|
||||
@@ -0,0 +1,64 @@
|
||||
// GrabberWizard unit tests: buildFileTypes, buildStartParams, buildHarvestParams. Lane GUI.
|
||||
//
|
||||
// Red when every file-type checkbox unchecked stops meaning "every type" (null, not an
|
||||
// empty array), a blank include/exclude field stops becoming schema null, or harvest
|
||||
// params drop a selected fileId.
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QtTest>
|
||||
|
||||
#include "dialogs/GrabberWizard.hpp"
|
||||
|
||||
using velox::gui::GrabberWizard;
|
||||
|
||||
class TstGrabberWizard : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void noFileTypesSelectedMeansNull();
|
||||
void selectedTypesAndCustomAreMerged();
|
||||
void blankFiltersBecomeNull();
|
||||
void filtersAreSplitOnCommaAndNewline();
|
||||
void harvestParamsCarrySelection();
|
||||
};
|
||||
|
||||
void TstGrabberWizard::noFileTypesSelectedMeansNull() {
|
||||
const QJsonValue v = GrabberWizard::buildFileTypes(false, false, false, false, false, "");
|
||||
QVERIFY(v.isNull());
|
||||
}
|
||||
|
||||
void TstGrabberWizard::selectedTypesAndCustomAreMerged() {
|
||||
const QJsonValue v =
|
||||
GrabberWizard::buildFileTypes(true, false, false, false, false, "iso, bin");
|
||||
QVERIFY(v.isArray());
|
||||
const QJsonArray a = v.toArray();
|
||||
QVERIFY(a.contains(QStringLiteral("jpg")));
|
||||
QVERIFY(a.contains(QStringLiteral("iso")));
|
||||
QVERIFY(a.contains(QStringLiteral("bin")));
|
||||
}
|
||||
|
||||
void TstGrabberWizard::blankFiltersBecomeNull() {
|
||||
const QJsonObject p =
|
||||
GrabberWizard::buildStartParams("https://example.test/", 2, true, "", "", QJsonValue());
|
||||
QVERIFY(p.value("includePatterns").isNull());
|
||||
QVERIFY(p.value("excludePatterns").isNull());
|
||||
QCOMPARE(p.value("depth").toInt(), 2);
|
||||
QCOMPARE(p.value("sameHostOnly").toBool(), true);
|
||||
}
|
||||
|
||||
void TstGrabberWizard::filtersAreSplitOnCommaAndNewline() {
|
||||
const QJsonObject p = GrabberWizard::buildStartParams("https://example.test/", 1, false,
|
||||
"*.jpg,*.png\n*.gif", "", QJsonValue());
|
||||
QCOMPARE(p.value("includePatterns").toArray().size(), 3);
|
||||
}
|
||||
|
||||
void TstGrabberWizard::harvestParamsCarrySelection() {
|
||||
const QJsonObject p = GrabberWizard::buildHarvestParams("job1", {"f1", "f2"}, "cat1", "later");
|
||||
QCOMPARE(p.value("jobId").toString(), QStringLiteral("job1"));
|
||||
QCOMPARE(p.value("select").toArray().size(), 2);
|
||||
QCOMPARE(p.value("defaults").toObject().value("categoryId").toString(), QStringLiteral("cat1"));
|
||||
QCOMPARE(p.value("defaults").toObject().value("startMode").toString(), QStringLiteral("later"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TstGrabberWizard)
|
||||
#include "tst_grabberwizard.moc"
|
||||
@@ -0,0 +1,54 @@
|
||||
// OptionsDialog::diffChanged unit tests. Lane GUI.
|
||||
//
|
||||
// Red when a key that didn't actually change starts getting resent to settings.set (it
|
||||
// would still work, but it defeats the fixture's "changed[] names exactly what took
|
||||
// effect" contract and spams event.settings.changed with noise), or a key present in
|
||||
// `current` but absent from `original` stops being treated as changed.
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QtTest>
|
||||
|
||||
#include "dialogs/OptionsDialog.hpp"
|
||||
|
||||
using velox::gui::OptionsDialog;
|
||||
|
||||
class TstOptionsDialog : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void identicalValuesProduceNoDiff();
|
||||
void onlyChangedKeysAreReturned();
|
||||
void keyAbsentFromOriginalCountsAsChanged();
|
||||
void allKeysAreNonEmptyAndUnique();
|
||||
};
|
||||
|
||||
void TstOptionsDialog::identicalValuesProduceNoDiff() {
|
||||
const QJsonObject original{{"connection.timeoutSec", 30}, {"proxy.mode", "system"}};
|
||||
const QJsonObject current = original;
|
||||
QVERIFY(OptionsDialog::diffChanged(original, current).isEmpty());
|
||||
}
|
||||
|
||||
void TstOptionsDialog::onlyChangedKeysAreReturned() {
|
||||
const QJsonObject original{{"connection.timeoutSec", 30}, {"proxy.mode", "system"}};
|
||||
const QJsonObject current{{"connection.timeoutSec", 60}, {"proxy.mode", "system"}};
|
||||
const QJsonObject changed = OptionsDialog::diffChanged(original, current);
|
||||
QCOMPARE(changed.size(), 1);
|
||||
QCOMPARE(changed.value("connection.timeoutSec").toInt(), 60);
|
||||
}
|
||||
|
||||
void TstOptionsDialog::keyAbsentFromOriginalCountsAsChanged() {
|
||||
const QJsonObject original{{"proxy.mode", "system"}};
|
||||
const QJsonObject current{{"proxy.mode", "system"}, {"proxy.port", 1080}};
|
||||
const QJsonObject changed = OptionsDialog::diffChanged(original, current);
|
||||
QCOMPARE(changed.size(), 1);
|
||||
QVERIFY(changed.contains("proxy.port"));
|
||||
}
|
||||
|
||||
void TstOptionsDialog::allKeysAreNonEmptyAndUnique() {
|
||||
const QStringList keys = OptionsDialog::allKeys();
|
||||
QVERIFY(!keys.isEmpty());
|
||||
QCOMPARE(QSet<QString>(keys.begin(), keys.end()).size(), keys.size());
|
||||
}
|
||||
|
||||
QTEST_MAIN(TstOptionsDialog)
|
||||
#include "tst_optionsdialog.moc"
|
||||
@@ -0,0 +1,62 @@
|
||||
// SchedulerDialog::buildSchedule unit tests. Lane GUI.
|
||||
//
|
||||
// Red when unchecking "use a schedule" stops sending JSON null (Schedule.schema.json:
|
||||
// null clears it and leaves the queue under manual control), "run until it drains" stops
|
||||
// nulling stopTime, or daysOfWeek/onceDate leak into the mode that ignores them.
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QtTest>
|
||||
|
||||
#include "dialogs/SchedulerDialog.hpp"
|
||||
|
||||
using velox::gui::SchedulerDialog;
|
||||
|
||||
class TstSchedulerDialog : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void disabledIsNull();
|
||||
void periodicIncludesDaysNotOnceDate();
|
||||
void onceIncludesOnceDateNotDays();
|
||||
void runUntilDrainsNullsStopTime();
|
||||
void explicitStopTimeIsKept();
|
||||
};
|
||||
|
||||
void TstSchedulerDialog::disabledIsNull() {
|
||||
const QJsonValue v =
|
||||
SchedulerDialog::buildSchedule(false, "once", "09:00", true, "17:00", {}, "2026-01-01");
|
||||
QVERIFY(v.isNull());
|
||||
}
|
||||
|
||||
void TstSchedulerDialog::periodicIncludesDaysNotOnceDate() {
|
||||
const QJsonValue v = SchedulerDialog::buildSchedule(true, "periodic", "09:00", true, "17:00",
|
||||
{1, 3, 5}, "2026-01-01");
|
||||
QVERIFY(v.isObject());
|
||||
const QJsonObject s = v.toObject();
|
||||
QCOMPARE(s.value("mode").toString(), QStringLiteral("periodic"));
|
||||
QCOMPARE(s.value("daysOfWeek").toArray().size(), 3);
|
||||
QVERIFY(!s.contains("onceDate"));
|
||||
}
|
||||
|
||||
void TstSchedulerDialog::onceIncludesOnceDateNotDays() {
|
||||
const QJsonValue v = SchedulerDialog::buildSchedule(true, "once", "09:00", true, "17:00",
|
||||
{1, 3, 5}, "2026-01-01");
|
||||
const QJsonObject s = v.toObject();
|
||||
QCOMPARE(s.value("onceDate").toString(), QStringLiteral("2026-01-01"));
|
||||
QVERIFY(!s.contains("daysOfWeek"));
|
||||
}
|
||||
|
||||
void TstSchedulerDialog::runUntilDrainsNullsStopTime() {
|
||||
const QJsonValue v =
|
||||
SchedulerDialog::buildSchedule(true, "once", "09:00", true, "17:00", {}, "2026-01-01");
|
||||
QVERIFY(v.toObject().value("stopTime").isNull());
|
||||
}
|
||||
|
||||
void TstSchedulerDialog::explicitStopTimeIsKept() {
|
||||
const QJsonValue v =
|
||||
SchedulerDialog::buildSchedule(true, "once", "09:00", false, "17:00", {}, "2026-01-01");
|
||||
QCOMPARE(v.toObject().value("stopTime").toString(), QStringLiteral("17:00"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TstSchedulerDialog)
|
||||
#include "tst_schedulerdialog.moc"
|
||||
@@ -0,0 +1,46 @@
|
||||
// SpeedLimiterDialog::buildParams unit tests. Lane GUI.
|
||||
//
|
||||
// Red when disabling the limiter stops zeroing globalBps, enabling it with 0 KiB/s stops
|
||||
// being clamped to 1 (Limiter.schema.json: "0 with enabled true means stop everything,
|
||||
// which the GUI must not offer"), or the KiB/s -> bytes/s conversion drifts.
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
#include "dialogs/SpeedLimiterDialog.hpp"
|
||||
|
||||
using velox::gui::SpeedLimiterDialog;
|
||||
|
||||
class TstSpeedLimiterDialog : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void disabledSendsZero();
|
||||
void enabledConvertsKibpsToBytesPerSec();
|
||||
void enabledClampsZeroToOne();
|
||||
void applyToRunningPassesThrough();
|
||||
};
|
||||
|
||||
void TstSpeedLimiterDialog::disabledSendsZero() {
|
||||
const QJsonObject p = SpeedLimiterDialog::buildParams(false, 512, false);
|
||||
QCOMPARE(p.value("enabled").toBool(), false);
|
||||
QCOMPARE(p.value("globalBps").toDouble(), 0.0);
|
||||
}
|
||||
|
||||
void TstSpeedLimiterDialog::enabledConvertsKibpsToBytesPerSec() {
|
||||
const QJsonObject p = SpeedLimiterDialog::buildParams(true, 512, false);
|
||||
QCOMPARE(p.value("enabled").toBool(), true);
|
||||
QCOMPARE(p.value("globalBps").toDouble(), 512.0 * 1024);
|
||||
}
|
||||
|
||||
void TstSpeedLimiterDialog::enabledClampsZeroToOne() {
|
||||
const QJsonObject p = SpeedLimiterDialog::buildParams(true, 0, false);
|
||||
QCOMPARE(p.value("globalBps").toDouble(), 1024.0);
|
||||
}
|
||||
|
||||
void TstSpeedLimiterDialog::applyToRunningPassesThrough() {
|
||||
QVERIFY(SpeedLimiterDialog::buildParams(true, 1, true).value("applyToRunning").toBool());
|
||||
QVERIFY(!SpeedLimiterDialog::buildParams(true, 1, false).value("applyToRunning").toBool());
|
||||
}
|
||||
|
||||
QTEST_MAIN(TstSpeedLimiterDialog)
|
||||
#include "tst_speedlimiterdialog.moc"
|
||||
Reference in New Issue
Block a user