Skip to content

Commit

Permalink
quotest: Minor refactoring of basic URI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal committed Jul 22, 2020
1 parent 6d804f5 commit bd74588
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/quotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,22 +664,19 @@ TEST_IMPL(visitResources)
};

// Basic tests
QUrl invalidUrl { "https://" };
invalidUrl.setAuthority("---:@@@");
const Uri emptyUri {}, uriFromEmptyUrl {},
bareSigil { QStringLiteral("#") },
invalidMatrixUri { QStringLiteral("matrix:&invalid@") },
matrixUriFromInvalidUrl { invalidUrl };

for (const auto& u: { emptyUri, uriFromEmptyUrl })
for (const auto& u: { Uri {}, Uri { QUrl {} } })
if (u.isValid() || !u.isEmpty()) {
clog << "Empty Matrix URI test failed" << endl;
FAIL_TEST();
}
if (bareSigil.isValid()) {
if (Uri { QStringLiteral("#") }.isValid()) {
clog << "Bare sigil URI test failed" << endl;
FAIL_TEST();
}
QUrl invalidUrl { "https://" };
invalidUrl.setAuthority("---:@@@");
const Uri matrixUriFromInvalidUrl { invalidUrl },
invalidMatrixUri { QStringLiteral("matrix:&invalid@") };
if (matrixUriFromInvalidUrl.isEmpty() || matrixUriFromInvalidUrl.isValid()) {
clog << "Invalid Matrix URI test failed" << endl;
FAIL_TEST();
Expand Down

0 comments on commit bd74588

Please sign in to comment.