summaryrefslogtreecommitdiff
path: root/src/tests/test_tracker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_tracker.cc')
-rw-r--r--src/tests/test_tracker.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/tests/test_tracker.cc b/src/tests/test_tracker.cc
index ae06c5e..8265903 100644
--- a/src/tests/test_tracker.cc
+++ b/src/tests/test_tracker.cc
@@ -34,21 +34,26 @@ void test_tracker_pattern_triggering() {
// With event-based triggering, only events at beat 0.0 trigger immediately.
// Test 1: At music_time = 0.0f, events at beat 0.0 trigger
+ // drums_basic:
+ // 0.00, ASSET_KICK_1
+ // 0.00, NOTE_A4
engine.update(0.0f);
- // Expect 3 voices: crash (beat 0.0), kick (beat 0.0), hihat (beat 0.0)
- assert(engine.get_active_voice_count() == 3);
+ // Expect 2 voices: kick + note
+ assert(engine.get_active_voice_count() == 2);
- // Test 2: At music_time = 0.25f (beat 0.5 @ 120 BPM), hihat event triggers
- // beat_duration = 60.0f / 120.0f = 0.5s per beat
- // beat 0.5 = 0.25s
+ // Test 2: At music_time = 0.25f (beat 0.5 @ 120 BPM), snare event triggers
+ // 0.25, ASSET_SNARE_1
engine.update(0.25f);
- // Expect 4 voices (3 previous + 1 hihat at beat 0.5)
- assert(engine.get_active_voice_count() == 4);
+ // Expect at least 2 voices (snare + maybe others)
+ // Exact count depends on sample duration (kick/note might have finished)
+ int voices = engine.get_active_voice_count();
+ assert(voices >= 2);
- // Test 3: At music_time = 0.5f (beat 1.0), hihat event triggers
+ // Test 3: At music_time = 0.5f (beat 1.0), kick event triggers
+ // 0.50, ASSET_KICK_1
engine.update(0.5f);
- // Expect 5 voices (4 previous + 1 hihat at beat 1.0)
- assert(engine.get_active_voice_count() == 5);
+ // Expect at least 3 voices (new kick + others)
+ assert(engine.get_active_voice_count() >= 3);
// Test 4: Advance to 2.0f - new patterns trigger at time 2.0f
engine.update(2.0f);