Pass data size to test function rather than rely on the global value.