Replace explicit array allocation in unit tests with use of std::vector.