Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2020-07-14 16:32:23 +0300
committerHannah von Reth <vonreth@kde.org>2020-07-15 11:40:55 +0300
commitcbcaeb9c1a6445f641c80fa43384f474f941c48b (patch)
treeceafe0cde3dd500b0f4566db0897a851acd58738 /test
parent266ceced0c814614a54651c628eeb110796e08fa (diff)
Fix assert overload, not supported by msvc
warning C4002: too many arguments for function-like macro invocation 'ENFORCE_1'
Diffstat (limited to 'test')
-rw-r--r--test/syncenginetestutils.h2
-rw-r--r--test/testoauth.cpp26
2 files changed, 14 insertions, 14 deletions
diff --git a/test/syncenginetestutils.h b/test/syncenginetestutils.h
index 7d2d256bf..858660c95 100644
--- a/test/syncenginetestutils.h
+++ b/test/syncenginetestutils.h
@@ -1215,7 +1215,7 @@ public:
// A new folder will update the local file state database on first sync.
// To have a state matching what users will encounter, we have to a sync
// using an identical local/remote file tree first.
- ENFORCE(syncOnce());
+ OC_ENFORCE(syncOnce());
}
void switchToVfs(QSharedPointer<OCC::Vfs> vfs, bool enableShell = false)
diff --git a/test/testoauth.cpp b/test/testoauth.cpp
index a68d71497..f2a7be471 100644
--- a/test/testoauth.cpp
+++ b/test/testoauth.cpp
@@ -135,8 +135,8 @@ public:
fakeQnam->setOverride([this](QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *device) {
if (req.url().path().endsWith(".well-known/openid-configuration"))
return this->wellKnownReply(op, req);
- ASSERT(device);
- ASSERT(device->bytesAvailable()>0); // OAuth2 always sends around POST data.
+ OC_ASSERT(device);
+ OC_ASSERT(device->bytesAvailable() > 0); // OAuth2 always sends around POST data.
return this->tokenReply(op, req);
});
@@ -180,11 +180,11 @@ public:
virtual QNetworkReply *tokenReply(QNetworkAccessManager::Operation op, const QNetworkRequest &req)
{
- ASSERT(state == BrowserOpened);
+ OC_ASSERT(state == BrowserOpened);
state = TokenAsked;
- ASSERT(op == QNetworkAccessManager::PostOperation);
- ASSERT(req.url().toString().startsWith(sOAuthTestServer.toString()));
- ASSERT(req.url().path() == sOAuthTestServer.path() + "/index.php/apps/oauth2/api/v1/token");
+ OC_ASSERT(op == QNetworkAccessManager::PostOperation);
+ OC_ASSERT(req.url().toString().startsWith(sOAuthTestServer.toString()));
+ OC_ASSERT(req.url().path() == sOAuthTestServer.path() + "/index.php/apps/oauth2/api/v1/token");
std::unique_ptr<QBuffer> payload(new QBuffer());
payload->setData(tokenReplyPayload());
return new FakePostReply(op, req, std::move(payload), fakeQnam);
@@ -265,14 +265,14 @@ private slots:
struct Test : OAuthTestCase {
QNetworkReply *tokenReply(QNetworkAccessManager::Operation op, const QNetworkRequest & req) override
{
- ASSERT(browserReply);
+ OC_ASSERT(browserReply);
// simulate the fact that the browser is closing the connection
browserReply->abort();
// don't process network events, as it messes up the execution order and
// causes an Qt internal crash
QCoreApplication::processEvents(QEventLoop::ExcludeSocketNotifiers);
- ASSERT(state == BrowserOpened);
+ OC_ASSERT(state == BrowserOpened);
state = TokenAsked;
std::unique_ptr<QBuffer> payload(new QBuffer);
@@ -347,7 +347,7 @@ private slots:
int redirectsDone = 0;
QNetworkReply *tokenReply(QNetworkAccessManager::Operation op, const QNetworkRequest & request) override
{
- ASSERT(browserReply);
+ OC_ASSERT(browserReply);
// Kind of reproduces what we had in https://github.com/owncloud/enterprise/issues/2951 (not 1:1)
if (redirectsDone == 0) {
std::unique_ptr<QBuffer> payload(new QBuffer());
@@ -378,7 +378,7 @@ private slots:
struct Test : OAuthTestCase {
int redirectsDone = 0;
QNetworkReply * wellKnownReply(QNetworkAccessManager::Operation op, const QNetworkRequest & req) override {
- ASSERT(op == QNetworkAccessManager::GetOperation);
+ OC_ASSERT(op == QNetworkAccessManager::GetOperation);
QJsonDocument jsondata(QJsonObject{
{ "authorization_endpoint", QJsonValue(
"oauthtest://openidserver" + sOAuthTestServer.path() + "/index.php/apps/oauth2/authorize") },
@@ -388,7 +388,7 @@ private slots:
}
void openBrowserHook(const QUrl & url) override {
- ASSERT(url.host() == "openidserver");
+ OC_ASSERT(url.host() == "openidserver");
QUrl url2 = url;
url2.setHost(sOAuthTestServer.host());
OAuthTestCase::openBrowserHook(url2);
@@ -396,8 +396,8 @@ private slots:
QNetworkReply *tokenReply(QNetworkAccessManager::Operation op, const QNetworkRequest & request) override
{
- ASSERT(browserReply);
- ASSERT(request.url().toString().startsWith("oauthtest://openidserver/token_endpoint"));
+ OC_ASSERT(browserReply);
+ OC_ASSERT(request.url().toString().startsWith("oauthtest://openidserver/token_endpoint"));
auto req = request;
req.setUrl(request.url().toString().replace("oauthtest://openidserver/token_endpoint",
sOAuthTestServer.toString() + "/index.php/apps/oauth2/api/v1/token"));