Add comments about tests dependencies and precedence

This commit is contained in:
jjceresa 2019-10-10 08:26:20 +02:00
parent c2bff2032a
commit ca02628981
6 changed files with 44 additions and 11 deletions

View file

@ -1921,6 +1921,8 @@ fluid_list_copy_linked_mod(const fluid_mod_t *list_mod, int dest_idx, int new_id
* - the number of linked modulators if any valid linked path exists.
* - 0 if no linked path exists.
* - FLUID_FAILED if failed (memory error).
*
* See test_modulator_links.c.
*/
int
fluid_list_check_linked_mod(char *list_name,

View file

@ -508,7 +508,9 @@ fluid_voice_calculate_gen_pitch(fluid_voice_t *voice)
voice->gen[GEN_PITCH].val = fluid_voice_calculate_pitch(voice, fluid_voice_get_actual_key(voice));
}
/* outsourced function that calculates modulator contributions to make it unit testable */
/* outsourced function that calculates modulator contributions to make it unit
testable. See test_modulator_amount.c.
*/
void fluid_voice_calculate_modulator_contributions(fluid_voice_t *voice)
{
int i;
@ -1186,6 +1188,8 @@ fluid_voice_update_param(fluid_voice_t *voice, int gen)
* This avoid the risk to call 'fluid_voice_update_param' several
* times for the same generator if several modulators have that generator as
* destination. So every changed generators are updated only once.
*
* See test_fluid_voice_modulate.c.
*/
/* bit table for each generator being updated. The bits are packed in variables
@ -1537,6 +1541,8 @@ fluid_voice_stop(fluid_voice_t *voice)
* #FLUID_VOICE_OVERWRITE to replace the modulator,
* #FLUID_VOICE_DEFAULT when adding a default modulator - no duplicate should
* exist so don't check.
*
* See test_fluid_voice_add_mod.c.
*/
void
fluid_voice_add_mod(fluid_voice_t *voice, fluid_mod_t *mod, int mode)
@ -1583,6 +1589,8 @@ fluid_voice_add_mod(fluid_voice_t *voice, fluid_mod_t *mod, int mode)
* (voice->mod_count), this will restrict identity check to this number,
* This is usefull when we know by advance that there is no duplicate with
* modulators at index above this limit. This avoid wasting cpu cycles at noteon.
*
* See test_fluid_voice_add_mod.c.
*/
void
fluid_voice_add_mod_local(fluid_voice_t *voice, fluid_mod_t *mod, int mode, int check_limit_count)
@ -1846,7 +1854,9 @@ int fluid_voice_get_velocity(const fluid_voice_t *voice)
* (see fluid_voice_calculate_runtime_synthesis_parameters())
*/
/* outsourced function that to make it unit testable */
/* outsourced function that to make it unit testable
See test_possible_att_reduction.c.
*/
fluid_real_t
fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t *voice)
{

View file

@ -7,12 +7,17 @@
Then mod_modulation is compared to the expected modulation value
(mod_modulation_expected).
Tests must be done for each type of modulator (simple or complex).
The comparison is done 2 times:
1) mod_modulation is compared to theorical expected modulation value.
2) mod_modulation is compared to the modulation computed by running
fluid_voice_calculate_modulator_contributions()
fluid_voice_calculate_modulator_contributions() (see note).
Tests must be done for each type of modulator (simple or complex).
Note about tests dependency and precedence:
These step is dependant of fluid_voice_calculate_modulator_contributions()
function. That means that any change in this function must be checked by
running test_modulator_amount before running test_fluid_voice_modulate.
----------------------------------------------------------------------------*/
#include "test.h"
#include "fluidsynth.h"

View file

@ -1,4 +1,6 @@
/*----------------------------------------------------------------------------
These tests check fluid_voice_calculate_modulator_contributions() function.
Test of value of linked/simple modulator.
For simple modulator:
out = src1 * src2 * amount.
@ -7,6 +9,9 @@ Test of value of linked/simple modulator.
out = link * src2 * amount
With link being the summing node input drived by the output of
one or more modulators.
Note about about test dependency and precedence:
See test_possible_att_reduction.c and test_fluid_voice_modulate.c.
----------------------------------------------------------------------------*/
#include "test.h"
#include "fluidsynth.h"

View file

@ -1,4 +1,6 @@
/*----------------------------------------------------------------------------
These tests check fluid_list_check_linked_mod() function.
----------------------------------------------------------------------------*/
#include "test.h"
#include "fluidsynth.h"
#include "synth/fluid_mod.h"

View file

@ -7,16 +7,25 @@
This leads to compute the minimum value contribution of this modulator (min_val_mod).
Then min_val_mod is compared to the expected minimun value of this modulator(min_val_expected).
For simple modulator the comparison is done 2 times:
1) min_val_mod is compared to theorical expected minimum value.
2) min_val_mod is comparaed to real expected minimum value computed by running the
modulator in the voice and driving source CC value from (min (0) to max(127)
before calling fluid_voice_calculate_modulator_contributions().
Tests must be done for each type of modulator (simple or complex).
For each type all test combinations should be done for:
- sources (unipolar/bipolar).
- and amount(positive/negative).
1)For simple modulator the comparison is done 2 times:
1.1) min_val_mod is compared to theorical expected minimum value.
1.2) min_val_mod is compared to real expected minimum value computed by running the
modulator in the voice and driving source CC value from (min (0) to max(127)
before calling fluid_voice_calculate_modulator_contributions().(see note)
2)For complex modulator, because there is no theorical expected minimum value
the comparison is done only using same step that 1.2.
Note about tests dependency and precedence:
These steps (1.2, 2.1))are dependant of fluid_voice_calculate_modulator_contributions()
function. That means that any change in this function must be checked by
running test_modulator_amount before running test_possible_att_reduction.
----------------------------------------------------------------------------*/
#include "test.h"
#include "fluidsynth.h"