Add test in test_modulator_amount.c

This commit is contained in:
jjceresa 2019-10-04 14:30:52 +02:00
parent 454e322ddb
commit c9447e74cd

View file

@ -118,7 +118,20 @@ int main(void)
TEST_ASSERT(float_equal(v->gen[GEN_FILTERFC].mod, v->mod[0].link * fluid_mod_get_amount(mod0)));
}
// TODO: same test using simple modulator.
// Same test using simple modulator: CC->m0->GEN_FILTERFC
{
v->gen[GEN_FILTERFC].mod = 0; // reset mod input
v->mod_count = 0; // clear voice modulator table.
fluid_mod_set_source1(mod0, CC, FLUID_MOD_CC | FLUID_MOD_LINEAR | FLUID_MOD_UNIPOLAR | FLUID_MOD_POSITIVE);
// Add one complex modulator using fluid_voice_add_mod().
fluid_voice_add_mod(v, mod0, FLUID_VOICE_DEFAULT);
fluid_voice_calculate_modulator_contributions(v);
TEST_ASSERT(float_equal(v->gen[GEN_FILTERFC].mod, fluid_mod_get_amount(mod0)));
}
delete_fluid_mod(mod0);
delete_fluid_mod(mod1);