re-factored the test and resolved an issue with buffer declaration that
was causing memory access errors