Skip to content

Commit

Permalink
test_utils: Fix Q_ASSERT
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Jan 10, 2025
1 parent 1435ae6 commit 041f761
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/src/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ void PrintTo(const ::QUrl &url, std::ostream &os) {
TemporaryResource::TemporaryResource(const QString &filename, QObject *parent) : QTemporaryFile(parent) {

setFileTemplate(QDir::tempPath() + u"/strawberry_test-XXXXXX."_s + filename.section(u'.', -1, -1));
Q_ASSERT(open());
bool success = open();
Q_ASSERT(success);

QFile resource(filename);
Q_ASSERT(resource.open(QIODevice::ReadOnly));
success = resource.open(QIODevice::ReadOnly);
Q_ASSERT(success);
write(resource.readAll());

reset();
Expand Down

0 comments on commit 041f761

Please sign in to comment.