October 2013
Intermediate to advanced
368 pages
9h 20m
English
We need to change code in
writeSamples
. Let’s start with a couple tests!
| wav/6/WavReaderTest.cpp | |
| | #include "CppUTest/TestHarness.h" |
| | #include "WavReader.h" |
| | #include <iostream> |
| | #include <string> |
| | #include <sstream> |
| | |
| | using namespace std; |
| | |
| | TEST_GROUP(WavReader_WriteSamples) |
| | { |
| | WavReader reader{"",""}; |
| | ostringstream out; |
| | }; |
| | |
| | TEST(WavReader_WriteSamples, WritesSingleSample) { |
| | char data[] { "abcd" }; |
| | uint32_t bytesPerSample { 1 }; |
| | uint32_t startingSample { 0 }; |
| | uint32_t samplesToWrite { 1 }; |
| | reader.writeSamples(&out, data, startingSample, samplesToWrite, bytesPerSample); |
| | CHECK_EQUAL("a", out.str()); |
| | } |
| | |
| | TEST(WavReader_WriteSamples, WritesMultibyteSampleFromMiddle) ... |
Read now
Unlock full access