Pass pointer parameters for captured variables

Also make one function self-contained.

Signed-off-by: Steve Powell <spowell@pivotal.io>
Improve test diagnostics

[#83769328]

Signed-off-by: Steve Powell <spowell@pivotal.io>
wip