diff options
| author | Christoph Berg <myon@debian.org> | 2026-10-09 14:12:49 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-10-09 14:12:49 +0200 |
| commit | 76956486fa7ef52a51d4e56df1e13a9f19a6c93c (patch) | |
| tree | fe0c394439fdc167d1970372e8998874090854dd /WavDecodeTestController.hpp | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
| parent | ffc62c792c9a5196cb4ce7a353287dfe20db6524 (diff) | |
Update upstream source from tag 'upstream/3.3.0_beta1+dfsg'
Update to upstream version '3.3.0~beta1+dfsg'
with Debian dir 85037bbb9376721108594b59b54ead82ac6924a3
Diffstat (limited to 'WavDecodeTestController.hpp')
| -rw-r--r-- | WavDecodeTestController.hpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/WavDecodeTestController.hpp b/WavDecodeTestController.hpp new file mode 100644 index 00000000..39336a59 --- /dev/null +++ b/WavDecodeTestController.hpp @@ -0,0 +1,53 @@ +#ifndef WAV_DECODE_TEST_CONTROLLER_HPP__ +#define WAV_DECODE_TEST_CONTROLLER_HPP__ + +#include <QObject> +#include <QString> +#include <QTemporaryDir> +#include <QTimer> + +class MainWindow; + +class WavDecodeTestController final : public QObject +{ +public: + enum class Mode {Jt9, Jt65, Q65, Fst4, Fst4w}; + + WavDecodeTestController (MainWindow * window, QString wavPath, + QString expectedMessage, Mode mode, QObject * parent = nullptr); + void begin (); + bool succeeded () const {return m_succeeded;} + +private: + void prepareWhenReady (); + enum class Stage {ShortFirst, Initial, Repeat, ShortBeforeMonitoring, ShortReplacement, ShortRepeat}; + bool expectsMessage () const {return m_stage == Stage::Initial || m_stage == Stage::Repeat;} + void loadShortWav (); + void decodeShortWavWhenReady (); + bool rejectsLiveRepeat (); + void completeCycle (quint64 generation); + void finish (QString const& error = {}); + + MainWindow * m_window; + Mode m_mode; + int m_period; + QString m_modeName; + QString m_wavPath; + QString m_expectedMessage; + QTemporaryDir m_fixtureDirectory; + Stage m_stage {Stage::ShortFirst}; + QTimer m_timeout; + QTimer m_prepareTimer; + QTimer m_modalTimer; + quint64 m_activeGeneration {0}; + quint64 m_lastGeneration {0}; + int m_completedCycles {0}; + bool m_awaitingCycle {false}; + bool m_observed {false}; + bool m_configured {false}; + bool m_started {false}; + bool m_finished {false}; + bool m_succeeded {false}; +}; + +#endif |
