Refuse every multi-track selected-tracks render, both scopes; make a failed mono collapse observable
This commit is contained in:
@@ -775,6 +775,24 @@ static void testCollapsePreservesQuietNaNBitPattern() {
|
||||
if (!pcm.empty()) CHECK(bitsFromFloat(pcm[0]) == kQuietNaNBits);
|
||||
}
|
||||
|
||||
// The file-side collapse has three outcomes, and a genuine I/O failure once reported
|
||||
// identically to "the channels differ" — a stereo file landing under a plain Ok. The
|
||||
// report is where they must part: Declined stays silent (a capture with nothing to
|
||||
// collapse reads as it always did), and the other two say different things.
|
||||
static void testCollapseOutcomesReportDistinctly() {
|
||||
const std::string declined = monoCollapseSuffix(MonoCollapseOutcome::Declined);
|
||||
const std::string collapsed = monoCollapseSuffix(MonoCollapseOutcome::Collapsed);
|
||||
const std::string failed = monoCollapseSuffix(MonoCollapseOutcome::Failed);
|
||||
|
||||
CHECK(declined.empty());
|
||||
CHECK(!collapsed.empty());
|
||||
CHECK(!failed.empty());
|
||||
CHECK(collapsed != failed);
|
||||
// The failure must read as a failure, not as a quieter success.
|
||||
CHECK(failed.find("failed") != std::string::npos);
|
||||
CHECK(collapsed.find("failed") == std::string::npos);
|
||||
}
|
||||
|
||||
int main() {
|
||||
testParseCanonicalStereo();
|
||||
testParseMonoAndLeadingChunk();
|
||||
@@ -810,6 +828,7 @@ int main() {
|
||||
testCollapseDeclinesOnUnparseableBytes();
|
||||
testCollapseChangesContentHash();
|
||||
testCollapsePreservesQuietNaNBitPattern();
|
||||
testCollapseOutcomesReportDistinctly();
|
||||
|
||||
if (g_fail == 0) std::printf("wav_codec: all tests passed\n");
|
||||
else std::printf("wav_codec: %d CHECK(s) FAILED\n", g_fail);
|
||||
|
||||
Reference in New Issue
Block a user