The size of the buffer was never set so the Get*PreferredUILanguages() were just returning ERROR_INSUFFICIENT_BUFFER. Fix the buffer size and use the returned count as sanity limit. Fixes the test.