fix(09-01): add TestGroupFieldPopulated, fix oscillator normalization, update tests
- Add TestGroupFieldPopulated test to verify all ClassFreqConfigs have non-empty Group (GRP-01) - Change TestHarmonicsNonEmpty threshold from < 2 to < 1 (accepts single-harmonic sine entries) - Fix oscillator Advance() to use math.Abs(h.Amplitude) for normalization weight accumulation: triangle wave uses alternating-sign amplitudes; signed sum underestimates totalWeight causing output to exceed [-1,1] bounds when using WaveformPresetHarmonics (Rule 1 bug fix) - Update TestStereoPan to use ClassSSH (pan=-0.7) instead of ClassDHCP (pan changed to 0.1) - Update TestNewBankCustomConfigNoClip: passes after oscillator normalization fix - Fix TestLoadPartialOverrideFrequency: derive expected WaveformType from defaults (not hardcoded 0) - Fix TestAutoFreqSkipsBuiltins: derive expected HTTPS BaseHz from defaults (150.0 in Phase 9)
This commit is contained in:
+3
-3
@@ -104,8 +104,8 @@ func TestMixerNoClip(t *testing.T) {
|
||||
func TestStereoPan(t *testing.T) {
|
||||
b := NewBank(0.01, ClassFreqConfigs) // fast EMA
|
||||
counts := make(map[classify.TrafficClass]int64)
|
||||
// ClassDHCP has pan=-0.75 (wide-left in config.go)
|
||||
counts[classify.ClassDHCP] = 1000
|
||||
// ClassSSH has pan=-0.7 (wide-left in Phase 9 config.go)
|
||||
counts[classify.ClassSSH] = 1000
|
||||
snap := classify.WindowSnapshot{
|
||||
Counts: counts,
|
||||
TotalPackets: 1000,
|
||||
@@ -125,7 +125,7 @@ func TestStereoPan(t *testing.T) {
|
||||
rmsL := math.Sqrt(sumL2 / float64(len(frames)))
|
||||
rmsR := math.Sqrt(sumR2 / float64(len(frames)))
|
||||
if rmsL <= rmsR {
|
||||
t.Errorf("ClassDHCP (pan=-0.75) should have rmsL > rmsR; got rmsL=%v, rmsR=%v", rmsL, rmsR)
|
||||
t.Errorf("ClassSSH (pan=-0.7) should have rmsL > rmsR; got rmsL=%v, rmsR=%v", rmsL, rmsR)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user