Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbashford committed Jul 18, 2019
1 parent 2286340 commit 67a235b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/google-tests/AdaptiveMethodTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ namespace av_speech_in_noise::tests {
assertEqual(1, s.floor);
}

void assertBumpLimitEqualsOne(const Track::Settings &s) {
assertEqual(1, s.bumpLimit);
}

void applyToSnrTrackFactoryParameters(
int n,
void(AdaptiveMethodTests::*f)(const Track::Settings &)
Expand Down Expand Up @@ -246,6 +250,18 @@ namespace av_speech_in_noise::tests {
);
}

TEST_F(
AdaptiveMethodTests,
initializeCreatesEachSnrTrackWithBumpLimit
) {
test.trackBumpLimit = 1;
initialize();
applyToSnrTrackFactoryParameters(
3,
&AdaptiveMethodTests::assertBumpLimitEqualsOne
);
}

TEST_F(
AdaptiveMethodTests,
writeTestParametersPassesToOutputFile
Expand Down
1 change: 1 addition & 0 deletions src/recognition-test/AdaptiveMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace av_speech_in_noise {
trackSettings.ceiling = p.ceilingSnr_dB;
trackSettings.startingX = p.startingSnr_dB;
trackSettings.floor = p.floorSnr_dB;
trackSettings.bumpLimit = p.trackBumpLimit;
lists = targetListSetReader->read(p.common.targetListDirectory);

selectNextListAfter(&AdaptiveMethod::makeSnrTracks);
Expand Down

0 comments on commit 67a235b

Please sign in to comment.