Skip to content

Commit

Permalink
Merge pull request #2927 from uklotzde/2.3_analyzerwaveformtest_debug…
Browse files Browse the repository at this point in the history
…assert

Delete invalid test: AnalyzerWaveformTest.wrongTotalSamples
  • Loading branch information
Holzhaus authored Jul 10, 2020
2 parents d967b0e + 3b30fb4 commit 48f0d04
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/test/analyserwaveformtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,4 @@ TEST_F(AnalyzerWaveformTest, canary) {
}
}

//Test to make sure that if an incorrect totalSamples is passed to
//initialize(..) and process(..) is told to process more samples than that,
//that we don't step out of bounds.
TEST_F(AnalyzerWaveformTest, wrongTotalSamples) {
aw.initialize(tio, tio->getSampleRate(), BIGBUF_SIZE / 2);
// Deliver double the expected samples
int wrongTotalSamples = BIGBUF_SIZE;
int blockSize = 2 * 32768;
for (int i = CANARY_SIZE; i < CANARY_SIZE + wrongTotalSamples; i += blockSize) {
aw.processSamples(&canaryBigBuf[i], blockSize);
}
aw.storeResults(tio);
aw.cleanup();
//Ensure the source buffer is intact
for (int i = CANARY_SIZE; i < BIGBUF_SIZE; i++) {
EXPECT_FLOAT_EQ(canaryBigBuf[i], MAGIC_FLOAT);
}
//Make sure our canaries are still OK
for (int i = 0; i < CANARY_SIZE; i++) {
EXPECT_FLOAT_EQ(canaryBigBuf[i], CANARY_FLOAT);
}
for (int i = CANARY_SIZE + BIGBUF_SIZE; i < 2 * CANARY_SIZE + BIGBUF_SIZE; i++) {
EXPECT_FLOAT_EQ(canaryBigBuf[i], CANARY_FLOAT);
}
}
} // namespace

0 comments on commit 48f0d04

Please sign in to comment.