Added array bounds checks to box unit test.

Added array bounds write checks to box unit tests, plus verification that the buffer is completely used.