From f50a1f9b3009a6068b8305da7881ca4d737c09b8 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Sun, 8 Oct 2023 00:23:19 -0700 Subject: [PATCH] fix unit tests for passthru --- src/test/01-Basic/215-chugraph-passthrough.ck | 2 +- src/test/01-Basic/216-chugen-passthrough.ck | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/test/01-Basic/215-chugraph-passthrough.ck b/src/test/01-Basic/215-chugraph-passthrough.ck index 2ac77fab2..7a6c94242 100644 --- a/src/test/01-Basic/215-chugraph-passthrough.ck +++ b/src/test/01-Basic/215-chugraph-passthrough.ck @@ -13,5 +13,5 @@ Step step => Node node => blackhole; 1::samp => now; // check if equal (or at least equal enough) -if( Math.equal(.5, step.last() ) ) +if( Math.equal(.5, node.last() ) ) <<< "success" >>>; diff --git a/src/test/01-Basic/216-chugen-passthrough.ck b/src/test/01-Basic/216-chugen-passthrough.ck index c51a0aa8f..1fdb4acf4 100644 --- a/src/test/01-Basic/216-chugen-passthrough.ck +++ b/src/test/01-Basic/216-chugen-passthrough.ck @@ -1,11 +1,19 @@ -class Crash extends Chugen { - fun float tick(float v) { +// verify basic Chugen passthru +class PassThru extends Chugen +{ + fun float tick(float v) + { return v; } } -SinOsc s => Crash c => dac; -440.0 => s.freq; -1::second => now; +// patch in the Node +Step step => PassThru node => blackhole; +// set step +.5 => step.next; +// let time pass +1::samp => now; -<<< "success" >>>; +// check if equal (or at least equal enough) +if( Math.equal(.5, node.last() ) ) + <<< "success" >>>;