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:
+10
-2
@@ -39,8 +39,8 @@ func TestFrequenciesUnique(t *testing.T) {
|
||||
|
||||
func TestHarmonicsNonEmpty(t *testing.T) {
|
||||
for class, cfg := range synth.ClassFreqConfigs {
|
||||
if len(cfg.Harmonics) < 2 {
|
||||
t.Errorf("class %q has fewer than 2 harmonics (got %d)", class, len(cfg.Harmonics))
|
||||
if len(cfg.Harmonics) < 1 {
|
||||
t.Errorf("class %q has no harmonics (got %d)", class, len(cfg.Harmonics))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,3 +59,11 @@ func TestClassFreqConfigsMatchAllClasses(t *testing.T) {
|
||||
len(synth.ClassFreqConfigs), len(classify.AllClasses()))
|
||||
}
|
||||
}
|
||||
|
||||
func TestGroupFieldPopulated(t *testing.T) {
|
||||
for class, cfg := range synth.ClassFreqConfigs {
|
||||
if cfg.Group == "" {
|
||||
t.Errorf("class %q has empty Group field in ClassFreqConfigs", class)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user