[llvm] r201811 - [Support] Correctly handle zero length inputs to UTF conversion functions on Windows.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Feb 21 14:25:31 PST 2014


> So, we can't directly test UTFxToUTFx() because it's not exposed in a
> header, as it's private to Windows support stuff. And we can't test it
> through GetArgumentVector() because it ignores the input arguments on
> Windows (because it has to get the Unicode arguments).
>
> Not really sure how to test this without either exposing UTFxToUTFx(),
> or unifying our different Unicode utilities.

Maybe a small hack like passing an empty name to exists and checking
which error is returned? That would test that the 8->16 conversion
doesn't fail. The 16->8 conversion seems harder. It looks like you
would need a case where windows always returns you an empty string.
Would setting some environment variable cause SHGetFolderPathW to
return an empty string?

Cheers,
Rafael



More information about the llvm-commits mailing list