1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-30 17:14:58 +01:00

test_utils: Fix Q_ASSERT

This commit is contained in:
Jonas Kvinge 2025-01-10 15:35:15 +01:00
parent 1435ae6dc0
commit 041f761921

View File

@ -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();