Skip to content

Commit a6bab1c

Browse files
committed
Tests: Worked around a juce::MemoryBlock resizing bug
1 parent 41e5f1d commit a6bab1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/tracktion_engine/audio_files/tracktion_AudioFile.test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ TEST_SUITE ("tracktion_engine")
2525
auto sampleRate = 44100.0;
2626
auto numSamples = toSamples (duration, sampleRate);
2727

28-
auto totalSizeBytes = static_cast<size_t> (numChannels * numSamples) * sizeof (int16_t);
28+
auto headerSizeBytes = static_cast<size_t> (5'888);
29+
auto totalSizeBytes = headerSizeBytes + static_cast<size_t> (numChannels * numSamples) * sizeof (int16_t);
2930
auto mb = juce::MemoryBlock (totalSizeBytes);
3031
auto os = std::unique_ptr<juce::OutputStream> (std::make_unique<juce::MemoryOutputStream> (mb, false));
3132
auto w = juce::WavAudioFormat().createWriterFor (os,

0 commit comments

Comments
 (0)