Skip to content

Commit

Permalink
feat(soundproxy_test): ensure a file can be opened with at least one …
Browse files Browse the repository at this point in the history
…provider
  • Loading branch information
Swiftb0y committed Sep 27, 2023
1 parent 420b678 commit be695ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/soundproxy_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <gtest/gtest.h>

#include <QTemporaryDir>
#include <QTemporaryFile>
#include <QtDebug>
Expand Down Expand Up @@ -176,6 +178,7 @@ TEST_F(SoundSourceProxyTest, open) {
const auto fileUrl = QUrl::fromLocalFile(filePath);
const auto providerRegistrations =
SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl);
bool couldOpenFile = false;
for (const auto& providerRegistration : providerRegistrations) {
mixxx::AudioSourcePointer pAudioSource = openAudioSource(
filePath,
Expand All @@ -187,10 +190,13 @@ TEST_F(SoundSourceProxyTest, open) {
// skip test file
continue;
}
couldOpenFile = true;
EXPECT_LT(0, pAudioSource->getSignalInfo().getChannelCount());
EXPECT_LT(0u, pAudioSource->getSignalInfo().getSampleRate());
EXPECT_FALSE(pAudioSource->frameIndexRange().empty());
}
// Ensure we can open the file with a least one provider.
EXPECT_TRUE(couldOpenFile);
}
}

Expand Down

0 comments on commit be695ef

Please sign in to comment.