| 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 | |