Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Sep 20, 2023
1 parent a0ff3ee commit 7edfd32
Show file tree
Hide file tree
Showing 10 changed files with 118,953 additions and 627,881 deletions.
6 changes: 3 additions & 3 deletions src/test/analyserwaveformtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ constexpr std::size_t kCanarySize = 1024 * 4;
constexpr float kMagicFloat = 1234.567890f;
constexpr float kCanaryFloat = 0.0f;
constexpr int kChannelCount = 2;
const QString kReferenceBuffersPath = QStringLiteral("/src/test/reference_buffers/");
const QString kReferenceBuffersPath = QStringLiteral("reference_buffers/");

class AnalyzerWaveformTest : public MixxxTest {
protected:
Expand Down Expand Up @@ -53,7 +53,7 @@ class AnalyzerWaveformTest : public MixxxTest {
const QString& reference_title) {
pWaveform->dump();

QFile f(QDir::currentPath() + kReferenceBuffersPath + reference_title);
QFile f(getTestDir().filePath(kReferenceBuffersPath + reference_title));
bool pass = true;
// If the file is not there, we will fail and write out the .actual
// reference file.
Expand Down Expand Up @@ -81,7 +81,7 @@ class AnalyzerWaveformTest : public MixxxTest {
qWarning() << "Buffer does not match" << reference_title
<< ", actual buffer written to "
<< "reference_buffers/" + fname_actual;
QFile actualFile(QDir::currentPath() + kReferenceBuffersPath + fname_actual);
QFile actualFile(getTestDir().filePath(kReferenceBuffersPath + fname_actual));
ASSERT_TRUE(actualFile.open(QFile::WriteOnly));
actualFile.write(actual);
actualFile.close();
Expand Down
24 changes: 12 additions & 12 deletions src/test/enginemixertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TEST_F(EngineMixerTest, SingleChannelOutputWorks) {
.WillOnce(Return(false));
EXPECT_CALL(*pChannel, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel, postProcess(160000))
EXPECT_CALL(*pChannel, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct the mock to just return when process() gets called.
Expand Down Expand Up @@ -129,7 +129,7 @@ TEST_F(EngineMixerTest, SingleChannelPFLOutputWorks) {
.WillOnce(Return(true));
EXPECT_CALL(*pChannel, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel, postProcess(160000))
EXPECT_CALL(*pChannel, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct the mock to just return when process() gets called.
Expand Down Expand Up @@ -179,7 +179,7 @@ TEST_F(EngineMixerTest, TwoChannelOutputWorks) {
.WillOnce(Return(false));
EXPECT_CALL(*pChannel1, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel1, postProcess(160000))
EXPECT_CALL(*pChannel1, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct channel 2 to claim it is active, main and not PFL.
Expand All @@ -197,7 +197,7 @@ TEST_F(EngineMixerTest, TwoChannelOutputWorks) {
.WillOnce(Return(false));
EXPECT_CALL(*pChannel2, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel2, postProcess(160000))
EXPECT_CALL(*pChannel2, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct the mock to just return when process() gets called.
Expand Down Expand Up @@ -250,7 +250,7 @@ TEST_F(EngineMixerTest, TwoChannelPFLOutputWorks) {
.WillOnce(Return(true));
EXPECT_CALL(*pChannel1, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel1, postProcess(160000))
EXPECT_CALL(*pChannel1, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct channel 2 to claim it is active, main and PFL.
Expand All @@ -268,7 +268,7 @@ TEST_F(EngineMixerTest, TwoChannelPFLOutputWorks) {
.WillOnce(Return(true));
EXPECT_CALL(*pChannel2, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel2, postProcess(160000))
EXPECT_CALL(*pChannel2, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct the mock to just return when process() gets called.
Expand Down Expand Up @@ -326,7 +326,7 @@ TEST_F(EngineMixerTest, ThreeChannelOutputWorks) {
.WillOnce(Return(false));
EXPECT_CALL(*pChannel1, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel1, postProcess(160000))
EXPECT_CALL(*pChannel1, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct channel 2 to claim it is active, main and not PFL.
Expand All @@ -344,7 +344,7 @@ TEST_F(EngineMixerTest, ThreeChannelOutputWorks) {
.WillOnce(Return(false));
EXPECT_CALL(*pChannel2, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel2, postProcess(160000))
EXPECT_CALL(*pChannel2, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct channel 3 to claim it is active, main and not PFL.
Expand All @@ -362,7 +362,7 @@ TEST_F(EngineMixerTest, ThreeChannelOutputWorks) {
.WillOnce(Return(false));
EXPECT_CALL(*pChannel3, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel3, postProcess(160000))
EXPECT_CALL(*pChannel3, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct the mock to just return when process() gets called.
Expand Down Expand Up @@ -423,7 +423,7 @@ TEST_F(EngineMixerTest, ThreeChannelPFLOutputWorks) {
.WillOnce(Return(true));
EXPECT_CALL(*pChannel1, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel1, postProcess(160000))
EXPECT_CALL(*pChannel1, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct channel 2 to claim it is active, main and not PFL.
Expand All @@ -441,7 +441,7 @@ TEST_F(EngineMixerTest, ThreeChannelPFLOutputWorks) {
.WillOnce(Return(true));
EXPECT_CALL(*pChannel2, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel2, postProcess(160000))
EXPECT_CALL(*pChannel2, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct channel 3 to claim it is active, main and not PFL.
Expand All @@ -459,7 +459,7 @@ TEST_F(EngineMixerTest, ThreeChannelPFLOutputWorks) {
.WillOnce(Return(true));
EXPECT_CALL(*pChannel3, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel3, postProcess(160000))
EXPECT_CALL(*pChannel3, postProcess(MAX_BUFFER_LEN))
.Times(1);

// Instruct the mock to just return when process() gets called.
Expand Down
Loading

0 comments on commit 7edfd32

Please sign in to comment.