diff options
Diffstat (limited to 'src/tests/test_tracker.cc')
| -rw-r--r-- | src/tests/test_tracker.cc | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/tests/test_tracker.cc b/src/tests/test_tracker.cc index 95e746b..ad84163 100644 --- a/src/tests/test_tracker.cc +++ b/src/tests/test_tracker.cc @@ -25,28 +25,15 @@ void test_tracker_pattern_triggering() { synth_init(); tracker_init(); - // Need a minimal set of samples for generation - // These values should match what's expected by the music.track file - // For testing purposes, we define dummy data here. In a real scenario, - // we'd rely on the generated g_tracker_samples, g_tracker_patterns, etc. - // This test focuses on the logic of tracker_update, not the full audio generation pipeline. - - // Assuming g_tracker_score, g_tracker_patterns, and g_tracker_samples are available globally - // after tracker_compiler has run. - - // Test 1: No triggers initially, active voices should be 0 + // Test 1: Trigger patterns at 0.0f tracker_update(0.0f); - assert(synth_get_active_voice_count() == 2); // Expect 2 voices (one for each pattern triggered at 0.0f) - - // Test 2: Advance time to first trigger (0.0f in music.track for drum_loop and hihat_roll) - // In our dummy music.track, there are two patterns triggered at 0.0f - // Each pattern has multiple events which trigger voices. - tracker_update(0.1f); // Advance just past the 0.0f trigger point + printf("Actual active voice count: %d\n", synth_get_active_voice_count()); + // Expect 3 voices (one for each pattern triggered at 0.0f: drum_loop, hihat_roll, em_melody) + assert(synth_get_active_voice_count() == 3); - // The exact number of voices depends on the music.track content. - // For the given music.track, two patterns are triggered at 0.0f. - // Each pattern registers one spectrogram and triggers one voice. - assert(synth_get_active_voice_count() == 2); + // Test 2: Advance time slightly + tracker_update(0.1f); + assert(synth_get_active_voice_count() == 3); // Test 3: Advance further, no new triggers until 4.0f tracker_update(3.0f); |
