Skip to content

Commit

Permalink
I expect this new test to fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
micsthepick committed Feb 27, 2024
1 parent 58e5c47 commit 691b7d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 5 additions & 5 deletions testing_defines.eel2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function assert_equal_exact(expected, actual, message) global() (
is_nan(expected) && is_nan(actual) ? 0 :
(is_pos_inf(expected) && is_pos_inf(actual)) || (is_neg_inf(expected) && is_neg_inf(actual)) ? 0 :
expected !== actual ? (
printf("expected: %g, was: %g. %s\n", expected, actual, message)
fprintf(3, "expected: %g, was: %g. %s\n", expected, actual, message)
) : 0;
);

Expand All @@ -19,7 +19,7 @@ function assert_near_equal(expected, tolerance, actual, message) global() (
is_nan(expected) || is_nan(actual) || is_nan(tolerance) ? 0 :
(is_pos_inf(expected) || is_neg_inf(expected)) && (is_pos_inf(actual) || is_neg_inf(actual)) ? 0 :
abs(expected - actual) > tolerance ? (
printf("expected: %g (±%g), was: %g. %s\n", expected, tolerance, actual, message)
fprintf(3, "expected: %g (±%g), was: %g. %s\n", expected, tolerance, actual, message)
) : 0;
);

Expand All @@ -28,11 +28,11 @@ function assert_near_equal(expected, tolerance, actual) (
);

function assert_true(boolean, message) global() (
(!boolean) ? printf("expected: true, was: false. %s\n", message)
(!boolean) ? fprintf(3, "expected: true, was: false. %s\n", message)
);

function assert_false(boolean, message) global() (
boolean ? printf("expected: false, was: true. %s\n", message)
boolean ? fprintf(3, "expected: false, was: true. %s\n", message)
);

function assert_true(boolean) global() (
Expand All @@ -41,4 +41,4 @@ function assert_true(boolean) global() (

function assert_false(boolean) global() (
assert_false(boolean, "");
);
);
14 changes: 12 additions & 2 deletions vocalrediso-jamesdsp.eel
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,16 @@ assert_near_equal(200, 0.001, spl0sum, "SAMPLE_1_1_TEST: spl0sum was not as expe
assert_near_equal(200, 0.001, spl1sum, "SAMPLE_1_1_TEST: spl1sum was not as expected");
//DEBUGPRINT("spl0sum=%g, spl1sum=%g\n", spl0sum, spl1sum);

//DEBUGPRINT("Testing Completed Without Crashing!\n");

*}IFTEST*/ // main test block
//DEBUGPRINT("SETUP: fft range is [0, srate/2] dry=100 wet=100\n");
slider1 = slider2 = 100;
slider5 = 0;
slider6 = srate/2;
//DEBUGPRINT("PDC_SILENCE_ON_PARTIAL_RANGE_TEST\n");
slider_code();
sum_first_pdc_samples(1, 1);
assert_equal_exact(0, spl0sum, "PDC_SILENCE_ON_PARTIAL_RANGE_TEST failed on spl0");
assert_equal_exact(0, spl1sum, "PDC_SILENCE_ON_PARTIAL_RANGE_TEST failed on spl1");

//DEBUGPRINT("Testing Completed Without Crashing!\n");
//*}IFTEST*/ // main test block

0 comments on commit 691b7d6

Please sign in to comment.