public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fooyin] f44: Fix tests
@ 2026-09-23 7:06 Elaine Gibson
0 siblings, 0 replies; only message in thread
From: Elaine Gibson @ 2026-09-23 7:06 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/fooyin
Branch : f44
Commit : d2947c4e45a55964f39357e0b42a2e3d0b788f5f
Author : Elaine Gibson <ypsvlq@gmail.com>
Date : 2026-09-23T08:04:38+01:00
Stats : +200/-0 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/fooyin/c/d2947c4e45a55964f39357e0b42a2e3d0b788f5f?branch=f44
Log:
Fix tests
---
diff --git a/51740ce564e83a2ba1d6ccca4e16dfd80a179bcc.patch b/51740ce564e83a2ba1d6ccca4e16dfd80a179bcc.patch
new file mode 100644
index 0000000..d818532
--- /dev/null
+++ b/51740ce564e83a2ba1d6ccca4e16dfd80a179bcc.patch
@@ -0,0 +1,51 @@
+From 51740ce564e83a2ba1d6ccca4e16dfd80a179bcc Mon Sep 17 00:00:00 2001
+From: Luke Taylor <luket@pm.me>
+Date: Tue, 22 Sep 2026 01:27:51 +0100
+Subject: [PATCH] [tests] Fix AccurateRip tests on big-endian systems
+
+Addresses #1655
+---
+ tests/core/engine/accurateriptest.cpp | 9 +++++----
+ tests/plugins/cdda/accurateriptest.cpp | 2 +-
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/tests/core/engine/accurateriptest.cpp b/tests/core/engine/accurateriptest.cpp
+index 440a7b2c7..923505998 100644
+--- a/tests/core/engine/accurateriptest.cpp
++++ b/tests/core/engine/accurateriptest.cpp
+@@ -19,8 +19,6 @@
+
+ #include <core/engine/verification/accuraterip.h>
+
+-#include <QtEndian>
+-
+ #include <gtest/gtest.h>
+
+ #include <cstring>
+@@ -41,8 +39,11 @@ AudioBuffer makeBuffer(const std::vector<uint32_t>& samples, const AudioFormat&
+ {
+ QByteArray pcm(static_cast<qsizetype>(samples.size() * sizeof(uint32_t)), '\0');
+ for(size_t index{0}; index < samples.size(); ++index) {
+- const uint32_t value = qToLittleEndian(samples.at(index));
+- std::memcpy(pcm.data() + static_cast<qsizetype>(index * sizeof(value)), &value, sizeof(value));
++ const auto left = static_cast<uint16_t>(samples.at(index));
++ const auto right = static_cast<uint16_t>(samples.at(index) >> 16);
++ const auto offset = index * sizeof(uint32_t);
++ std::memcpy(pcm.data() + offset, &left, sizeof(left));
++ std::memcpy(pcm.data() + offset + sizeof(left), &right, sizeof(right));
+ }
+ return {reinterpret_cast<const uint8_t*>(pcm.constData()), static_cast<size_t>(pcm.size()), format, 0};
+ }
+diff --git a/tests/plugins/cdda/accurateriptest.cpp b/tests/plugins/cdda/accurateriptest.cpp
+index f155c0598..5bfe35456 100644
+--- a/tests/plugins/cdda/accurateriptest.cpp
++++ b/tests/plugins/cdda/accurateriptest.cpp
+@@ -140,7 +140,7 @@ TEST(AccurateRipTest, VerifiesOffsetCorrectedSourcePcm)
+ AccurateRip::Verifier verifier{*layout, {pressing}, tracks};
+
+ QByteArray pcm(FramesPerSector * 4LL, '\0');
+- const uint32_t values[]{qToLittleEndian(1), qToLittleEndian(2), qToLittleEndian(3)};
++ static constexpr uint16_t values[]{1, 0, 2, 0, 3, 0};
+ std::memcpy(pcm.data(), values, sizeof(values));
+ const AudioFormat format{SampleFormat::S16, 44100, 2};
+ const AudioBuffer buffer{reinterpret_cast<const uint8_t*>(pcm.constData()), static_cast<size_t>(pcm.size()), format,
diff --git a/6b7717e2843b815fbe42850b201baebfa5eebfa7.patch b/6b7717e2843b815fbe42850b201baebfa5eebfa7.patch
new file mode 100644
index 0000000..2d29568
--- /dev/null
+++ b/6b7717e2843b815fbe42850b201baebfa5eebfa7.patch
@@ -0,0 +1,147 @@
+From 6b7717e2843b815fbe42850b201baebfa5eebfa7 Mon Sep 17 00:00:00 2001
+From: Luke Taylor <luket@pm.me>
+Date: Tue, 22 Sep 2026 01:19:45 +0100
+Subject: [PATCH] [app] CommandLine: Harden option parsing and serialisation
+
+Reset getopt state between parses and validate before allocating data
+
+Addresses #1654
+---
+ src/app/commandline.cpp | 63 +++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 58 insertions(+), 5 deletions(-)
+
+diff --git a/src/app/commandline.cpp b/src/app/commandline.cpp
+index 084fe8404..5ac5645bf 100644
+--- a/src/app/commandline.cpp
++++ b/src/app/commandline.cpp
+@@ -31,6 +31,10 @@
+
+ using namespace Qt::StringLiterals;
+
++constexpr quint32 CommandOptionsMagic = 0x46594f50;
++constexpr quint8 CommandOptionsVersion = 1;
++constexpr qsizetype MaxCommandOptionsSize = 4UL * 1024 * 1024;
++
+ namespace {
+ enum CommandOption : uint16_t // NOLINT
+ {
+@@ -157,7 +161,13 @@ CommandLine::ParseResult CommandLine::parse()
+ m_repeatMode = RepeatMode::Unchanged;
+ m_shuffleMode = ShuffleMode::Unchanged;
+
+- optind = 1;
++ // Reset getopt
++#ifdef Q_OS_BSD4
++ optind = 1;
++ optreset = 1;
++#else
++ optind = 0;
++#endif
+ opterr = 0;
+
+ static constexpr option cmdOptions[] = {
+@@ -435,7 +445,7 @@ std::optional<uint64_t> CommandLine::parseSeekTime(const QStringView value)
+ if(!part || (i > 0 && *part >= 60)) {
+ return {};
+ }
+- if(seconds > ((std::numeric_limits<uint64_t>::max)() - *part) / 60) {
++ if(seconds > (std::numeric_limits<uint64_t>::max() - *part) / 60) {
+ return {};
+ }
+ seconds = (seconds * 60) + *part;
+@@ -518,7 +528,8 @@ QByteArray CommandLine::saveOptions() const
+ QDataStream stream(&out, QDataStream::WriteOnly);
+ stream.setVersion(QDataStream::Qt_6_0);
+
+- stream << m_files;
++ stream << CommandOptionsMagic;
++ stream << CommandOptionsVersion;
+ stream << m_skipSingle;
+ stream << static_cast<quint8>(m_playerAction);
+ stream << static_cast<quint64>(m_seekDelta);
+@@ -526,16 +537,27 @@ QByteArray CommandLine::saveOptions() const
+ stream << m_volume;
+ stream << static_cast<quint8>(m_repeatMode);
+ stream << static_cast<quint8>(m_shuffleMode);
++ stream << static_cast<quint32>(m_files.size());
++
++ for(const QUrl& file : m_files) {
++ stream << file.toEncoded(QUrl::FullyEncoded);
++ }
+
+ return out;
+ }
+
+ bool CommandLine::loadOptions(const QByteArray& options)
+ {
++ if(options.size() > MaxCommandOptionsSize) {
++ return false;
++ }
++
+ QByteArray in{options};
+ QDataStream stream(&in, QDataStream::ReadOnly);
+ stream.setVersion(QDataStream::Qt_6_0);
+
++ quint32 magic{0};
++ quint8 version{0};
+ QList<QUrl> files;
+ bool skipSingle{false};
+ quint8 playerAction{0};
+@@ -544,8 +566,15 @@ bool CommandLine::loadOptions(const QByteArray& options)
+ double volume{0.0};
+ quint8 repeatMode{0};
+ quint8 shuffleMode{0};
++ quint32 fileCount{0};
++
++ stream >> magic;
++ stream >> version;
++
++ if(magic != CommandOptionsMagic || version != CommandOptionsVersion) {
++ return false;
++ }
+
+- stream >> files;
+ stream >> skipSingle;
+ stream >> playerAction;
+ stream >> seekDelta;
+@@ -553,8 +582,9 @@ bool CommandLine::loadOptions(const QByteArray& options)
+ stream >> volume;
+ stream >> repeatMode;
+ stream >> shuffleMode;
++ stream >> fileCount;
+
+- if(stream.status() != QDataStream::Ok || !stream.atEnd()) {
++ if(stream.status() != QDataStream::Ok) {
+ return false;
+ }
+
+@@ -571,6 +601,29 @@ bool CommandLine::loadOptions(const QByteArray& options)
+ return false;
+ }
+
++ files.reserve(fileCount);
++ for(quint32 i{0}; i < fileCount; ++i) {
++ quint32 urlSize{0};
++ stream >> urlSize;
++
++ const int encodedSize = static_cast<int>(urlSize);
++ QByteArray encodedUrl(encodedSize, Qt::Uninitialized);
++
++ if(stream.readRawData(encodedUrl.data(), encodedSize) != encodedSize) {
++ return false;
++ }
++
++ QUrl url = QUrl::fromEncoded(encodedUrl, QUrl::StrictMode);
++ if(!url.isValid()) {
++ return false;
++ }
++ files.append(std::move(url));
++ }
++
++ if(!stream.atEnd()) {
++ return false;
++ }
++
+ m_files = std::move(files);
+ m_skipSingle = skipSingle;
+ m_playerAction = static_cast<PlayerAction>(playerAction);
diff --git a/fooyin.spec b/fooyin.spec
index 0533340..be177ec 100644
--- a/fooyin.spec
+++ b/fooyin.spec
@@ -6,6 +6,8 @@ Summary: A customizable music player
License: GPL-3.0-or-later
URL: https://www.fooyin.org/
Source0: https://github.com/fooyin/fooyin/archive/v%{version}/fooyin-%{version}.tar.gz
+Patch0: https://github.com/fooyin/fooyin/commit/6b7717e2843b815fbe42850b201baebfa5eebfa7.patch
+Patch1: https://github.com/fooyin/fooyin/commit/51740ce564e83a2ba1d6ccca4e16dfd80a179bcc.patch
BuildRequires: cmake
BuildRequires: gcc-c++
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-23 7:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 7:06 [rpms/fooyin] f44: Fix tests Elaine Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox