MCPcopy Create free account
hub / github.com/audacity/audacity / TestGetGarbageInput

Method TestGetGarbageInput

tests/SequenceTest.cpp:113–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 void TestGetGarbageInput()
114 {
115 std::cout << "\tSequence::Get() should return false (and not crash) if given garbage input..." << std::flush;
116
117 /* Create 10 samples in the sequence so the Set requests will
118 * be valid */
119 samplePtr appendBuf = NewSamples(10, floatSample);
120 mSequence->Append(appendBuf, floatSample, 10);
121
122 /* should fail, "get" buffer should not be null */
123 assert(mSequence->Get(NULL, floatSample, 0, 10) == false);
124
125 /* should fail, -1 is not a valid offset */
126 assert(mSequence->Get(appendBuf, floatSample, -1, 10) == false);
127
128 /* should fail, the sequence is only 10 samples long */
129 assert(mSequence->Get(appendBuf, floatSample, 0, 15) == false);
130
131 std::cout << "ok\n";
132 }
133
134};
135

Callers 1

mainFunction · 0.80

Calls 2

AppendMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected