Skip to content

Commit

Permalink
Revise unit tests for the Bittern
Browse files Browse the repository at this point in the history
Issue #370 Unit tests need to be revised because of accumulating more acoustic events as a result of having multiple decibel thresholds.
  • Loading branch information
towsey authored and atruskie committed Oct 14, 2020
1 parent 773181d commit dee47b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Profiles:
MinDuration: 0.3
MaxDuration: 0.8
DecibelThresholds:
- 3.0
- 6.0
- 12.0

Expand All @@ -47,7 +48,7 @@ PostProcessing:
SyllableSequence:
CombinePossibleSyllableSequence: true
SyllableStartDifference: 3.0
SyllableHertzGap: 35
SyllableHertzGap: 40
FilterSyllableSequence: true
SyllableMaxCount: 6
ExpectedPeriod: 2.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,21 @@ public void TestRecognizer()

Assert.AreEqual(1, events.Count);
Assert.IsNull(scoreTrack);
Assert.AreEqual(1, plots.Count);
Assert.AreEqual(3, plots.Count);
Assert.AreEqual(938, sonogram.FrameCount);

Assert.IsInstanceOfType(events[0], typeof(CompositeEvent));

var onlyEvent = (CompositeEvent)events[0];

Assert.AreEqual(5, onlyEvent.ComponentCount);
//note this event contains only three syllables but 7 events because have used two decibel thresholds.
Assert.AreEqual(12, onlyEvent.ComponentCount);
Assert.AreEqual(5.12, onlyEvent.EventStartSeconds);
Assert.AreEqual(12.256, onlyEvent.EventEndSeconds);
Assert.AreEqual(105, onlyEvent.LowFrequencyHertz);
Assert.AreEqual(180, onlyEvent.HighFrequencyHertz);
Assert.AreEqual(21.716400254, onlyEvent.Score, TestHelper.AllowedDelta);
Assert.AreEqual(0.9470146022, onlyEvent.ScoreNormalized, TestHelper.AllowedDelta);
Assert.AreEqual(28.078038296020, onlyEvent.Score, TestHelper.AllowedDelta);
Assert.AreEqual(0.024466803702, onlyEvent.ScoreNormalized, TestHelper.AllowedDelta);
}
}
}

0 comments on commit dee47b7

Please sign in to comment.