Phase 10: Audit engine reliability and strengthen lifecycle regression tests
This commit is contained in:
parent
4eb2080933
commit
8dd96d3cc5
13 changed files with 394 additions and 5 deletions
|
|
@ -79,6 +79,33 @@ static int routing(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* External mono input is read by both channels, including when left aliases it. */
|
||||
static int stereo_alias(void)
|
||||
{
|
||||
xtc_graph *graph = NULL;
|
||||
xtc_plan *plan = NULL;
|
||||
size_t gain, audio, output, i;
|
||||
float left[4] = {1, 2, 3, 4}, right[4];
|
||||
CHECK(xtc_graph_create(3, &graph) == XTC_OK);
|
||||
CHECK(xtc_graph_add_gain(graph, 2, &gain) == XTC_OK);
|
||||
CHECK(xtc_graph_add_audio(graph, &audio) == XTC_OK);
|
||||
CHECK(xtc_graph_add_output(graph, &output) == XTC_OK);
|
||||
CHECK(xtc_graph_connect(graph, gain, output) == XTC_OK);
|
||||
CHECK(xtc_graph_connect(graph, audio, output) == XTC_OK);
|
||||
CHECK(xtc_graph_compile(graph, 48000, 4, &plan) == XTC_OK);
|
||||
CHECK(xtc_plan_process_stereo(plan, left, NULL, NULL, NULL, NULL, left, right, 4) == XTC_OK);
|
||||
for (i = 0; i < 4; ++i)
|
||||
CHECK(left[i] == 2 * (float)(i + 1) && right[i] == left[i]);
|
||||
for (i = 0; i < 4; ++i) right[i] = 10 + (float)i;
|
||||
/* Cross-channel source alias must also retain the original source samples. */
|
||||
CHECK(xtc_plan_process_stereo(plan, NULL, right, left, NULL, NULL, left, right, 4) == XTC_OK);
|
||||
for (i = 0; i < 4; ++i)
|
||||
CHECK(left[i] == 10 + (float)i && right[i] == 2 * (float)(i + 1));
|
||||
xtc_plan_destroy(plan);
|
||||
xtc_graph_destroy(graph);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int validation(void)
|
||||
{
|
||||
xtc_graph *graph = NULL;
|
||||
|
|
@ -133,6 +160,7 @@ int main(void)
|
|||
CHECK(oscillator() == 0);
|
||||
CHECK(routing() == 0);
|
||||
CHECK(validation() == 0);
|
||||
CHECK(stereo_alias() == 0);
|
||||
puts("All offline graph tests passed.");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue