Check the phase oscillator of synfx-dsp-jit and make sure everything works as expected
This commit is contained in:
parent
147e5ee18a
commit
d6b37e68d0
1 changed files with 50 additions and 0 deletions
|
@ -39,3 +39,53 @@ fn check_node_code_1() {
|
||||||
assert_decimated_feq!(res.0, 50, vec![0.3; 10]);
|
assert_decimated_feq!(res.0, 50, vec![0.3; 10]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check_node_code_state() {
|
||||||
|
let (mut matrix, mut node_exec) = setup();
|
||||||
|
|
||||||
|
let block_fun = matrix.get_block_function(0).expect("block fun exists");
|
||||||
|
{
|
||||||
|
let mut block_fun = block_fun.lock().expect("matrix lock");
|
||||||
|
block_fun.instanciate_at(0, 0, 2, "value", Some("220.0".to_string()));
|
||||||
|
block_fun.instanciate_at(0, 1, 2, "phase", None);
|
||||||
|
block_fun.instanciate_at(0, 1, 3, "value", Some("2.0".to_string()));
|
||||||
|
block_fun.instanciate_at(0, 2, 2, "*", None);
|
||||||
|
block_fun.instanciate_at(0, 3, 1, "-", None);
|
||||||
|
block_fun.instanciate_at(0, 2, 1, "value", Some("1.0".to_string()));
|
||||||
|
block_fun.instanciate_at(0, 4, 1, "set", Some("&sig1".to_string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix.check_block_function(0).expect("no compile error");
|
||||||
|
|
||||||
|
let fft = run_and_get_fft4096_now(&mut node_exec, 50);
|
||||||
|
// Aliasing sawtooth I expect:
|
||||||
|
assert_eq!(
|
||||||
|
fft,
|
||||||
|
vec![
|
||||||
|
(205, 133),
|
||||||
|
(215, 576),
|
||||||
|
(226, 527),
|
||||||
|
(237, 90),
|
||||||
|
(431, 195),
|
||||||
|
(441, 322),
|
||||||
|
(452, 131),
|
||||||
|
(646, 61),
|
||||||
|
(657, 204),
|
||||||
|
(668, 157),
|
||||||
|
(872, 113),
|
||||||
|
(883, 155),
|
||||||
|
(894, 51),
|
||||||
|
(1098, 127),
|
||||||
|
(1109, 82),
|
||||||
|
(1314, 85),
|
||||||
|
(1324, 98),
|
||||||
|
(1540, 93),
|
||||||
|
(1755, 70),
|
||||||
|
(1766, 67),
|
||||||
|
(1981, 72),
|
||||||
|
(2196, 60),
|
||||||
|
(2422, 57),
|
||||||
|
(2638, 52)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue