mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-25 13:21:19 +00:00
Prevent uninitialized use of prev_preset and assume VintageDreams soundfont for test
This commit is contained in:
parent
efa97718fa
commit
fdd6804ae8
1 changed files with 6 additions and 5 deletions
|
@ -5,18 +5,17 @@
|
|||
|
||||
int main(void)
|
||||
{
|
||||
char *s;
|
||||
int id;
|
||||
fluid_sfont_t *sfont;
|
||||
fluid_preset_t *preset;
|
||||
fluid_preset_t *prev_preset;
|
||||
fluid_preset_t *prev_preset = NULL;
|
||||
int count = 0;
|
||||
|
||||
/* setup */
|
||||
fluid_settings_t *settings = new_fluid_settings();
|
||||
fluid_synth_t *synth = new_fluid_synth(settings);
|
||||
fluid_settings_dupstr(settings, "synth.default-soundfont", &s);
|
||||
id = fluid_synth_sfload(synth, s, 1);
|
||||
/* Load the VintageDreams soundfont */
|
||||
id = fluid_synth_sfload(synth, DEFAULT_SOUNDFONT, 1);
|
||||
sfont = fluid_synth_get_sfont_by_id(synth, id);
|
||||
|
||||
/* code under test */
|
||||
|
@ -27,10 +26,12 @@ int main(void)
|
|||
|
||||
/* make sure we actually got a different preset */
|
||||
TEST_ASSERT(preset != prev_preset);
|
||||
|
||||
prev_preset = preset;
|
||||
}
|
||||
|
||||
TEST_ASSERT(count > 0);
|
||||
/* VintageDreams has 136 presets */
|
||||
TEST_ASSERT(count == 136);
|
||||
|
||||
/* teardown */
|
||||
delete_fluid_synth(synth);
|
||||
|
|
Loading…
Reference in a new issue