Skip to content
This repository was archived by the owner on Mar 28, 2026. It is now read-only.

Commit c47e643

Browse files
committed
Fix SystemComponent unit tests
Turns SystemComponent::extractBaseUrl() into a static method so that the unit tests pass when run locally.
1 parent ece1c03 commit c47e643

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/system/SystemComponent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SystemComponent : public ComponentBase
4444
Q_INVOKABLE void cancelServerConnectivity();
4545
Q_SIGNAL void serverConnectivityResult(QString url, bool success, QString resolvedUrl);
4646

47-
QString extractBaseUrl(const QString& url);
47+
static QString extractBaseUrl(const QString& url);
4848
void resolveUrl(const QString& url, std::function<void(const QString&)> callback);
4949

5050
Q_INVOKABLE QString getUserAgent();

tests/test_systemcomponent.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ void TestSystemComponent::testExtractBaseUrl()
141141
QFETCH(QString, input);
142142
QFETCH(QString, expected);
143143

144-
SystemComponent* component = &SystemComponent::Get();
145-
QString result = component->extractBaseUrl(input);
144+
QString result = SystemComponent::extractBaseUrl(input);
146145

147146
QCOMPARE(result, expected);
148147
}

0 commit comments

Comments
 (0)