diff --git a/testing_defines.eel2 b/testing_defines.eel2 index 698b10d..f58fc7d 100644 --- a/testing_defines.eel2 +++ b/testing_defines.eel2 @@ -1,11 +1,4 @@ -// Helper functions to check for positive infinity, negative infinity, and nan -function is_pos_inf(x) (x == 1/0); -function is_neg_inf(x) (x == -1/0); -function is_nan(x) (x != x;); - function assert_equal_exact(expected, actual, message) global(failed_asserts, successful_asserts) ( - is_nan(expected) && is_nan(actual) ? successful_asserts += 1 : - (is_pos_inf(expected) && is_pos_inf(actual)) || (is_neg_inf(expected) && is_neg_inf(actual)) ? successful_asserts += 1 : expected !== actual ? ( fprintf(3, "\033[0;31mexpected: %g, was: %g. %s\033[0m\n", expected, actual, message); failed_asserts += 1; @@ -17,8 +10,6 @@ function assert_equal_exact(expected, actual) global() ( ); function assert_near_equal(expected, tolerance, actual, message) global(failed_asserts, successful_asserts) ( - is_nan(expected) || is_nan(actual) || is_nan(tolerance) ? successful_asserts += 1 : - (is_pos_inf(expected) || is_neg_inf(expected)) && (is_pos_inf(actual) || is_neg_inf(actual)) ? successful_asserts += 1 : abs(expected - actual) > tolerance ? ( fprintf(3, "\033[0;31mexpected: %g (±%g), was: %g. %s\033[0m\n", expected, tolerance, actual, message); failed_asserts += 1; diff --git a/vocalrediso-jamesdsp.eel b/vocalrediso-jamesdsp.eel index c2c7435..7719321 100644 --- a/vocalrediso-jamesdsp.eel +++ b/vocalrediso-jamesdsp.eel @@ -336,7 +336,7 @@ slider6 = srate/2; slider_code(); //DEBUGPRINT("SAMPLE_0_0_TEST\n"); -// spl0=0 spl1=0 for buffer_length*2 samples +// spl0=0 spl1=0 for 100 output samples sum_first_pdc_samples(0, 0); assert_equal_exact(0, spl0sum, "spl0sum for init"); assert_equal_exact(0, spl1sum, "spl1sum for init"); @@ -353,7 +353,7 @@ assert_near_equal(0, 0.001, spl1sum, "SAMPLE_0_0_TEST: spl1sum was not as expect //DEBUGPRINT("spl0sum=%g, spl1sum=%g\n", spl0sum, spl1sum); //DEBUGPRINT("SAMPLE_1_0_TEST\n"); -// spl0=1 spl1=0 for buffer_length*2 samples +// spl0=1 spl1=0 for for 100 output samples sum_first_pdc_samples(1, 0); assert_equal_exact(0, spl0sum, "spl0sum for init"); assert_equal_exact(0, spl1sum, "spl1sum for init"); @@ -370,7 +370,7 @@ assert_near_equal(0, 0.001, spl1sum, "SAMPLE_1_0_TEST: spl1sum was not as expect //DEBUGPRINT("spl0sum=%g, spl1sum=%g\n", spl0sum, spl1sum); //DEBUGPRINT("SAMPLE_0_1_TEST\n"); -// spl0=0 spl1=1 for buffer_length*2 samples +// spl0=0 spl1=1 for for 100 output samples sum_first_pdc_samples(0, 1); assert_equal_exact(0, spl0sum, "spl0sum for init"); assert_equal_exact(0, spl1sum, "spl1sum for init"); @@ -387,7 +387,7 @@ assert_near_equal(100, 0.001, spl1sum, "SAMPLE_0_1_TEST: spl1sum was not as expe //DEBUGPRINT("spl0sum=%g, spl1sum=%g\n", spl0sum, spl1sum); //DEBUGPRINT("SAMPLE_1_1_TEST\n"); -// spl0=1 spl1=1 for buffer_length*2 samples +// spl0=1 spl1=1 for for 100 output samples sum_first_pdc_samples(1, 1); assert_equal_exact(0, spl0sum, "spl0sum for init"); assert_equal_exact(0, spl1sum, "spl1sum for init"); @@ -405,6 +405,7 @@ assert_near_equal(200, 0.001, spl1sum, "SAMPLE_1_1_TEST: spl1sum was not as expe //DEBUGPRINT("SETUP: fft range is [srate/4, srate/2] dry=100 wet=100\n"); +// check no values before first output sample slider1 = slider2 = 100; slider5 = srate/4; slider6 = srate/2;