[1/2] ntdll/tests: Add tests for RtlUnicodeToUTF8N.

Thomas Faber thomas.faber at reactos.org
Sat Mar 29 13:33:19 CDT 2014


On 2014-03-29 17:24, Nikolay Sivov wrote:
> On 3/29/2014 20:16, Thomas Faber wrote:
>> +    /* output truncation */
>> +#define truncate_expect(len, out_len, expect_status) do {                   \
>> +        bytes_out = 0x55555555;                                             \
>> +        memset(buffer, 0x55, sizeof(buffer));                               \
>> +        status = pRtlUnicodeToUTF8N(                                         \
>> +            buffer, len, &bytes_out,                                        \
>> +            special_string, sizeof(special_string));                        \
>> +        ok(status == (expect_status), "status = 0x%x\n", status);           \
>> +        ok(bytes_out == (out_len), "bytes_out = %u\n", bytes_out);          \
>> +        for (i = 0; i < bytes_out; i++)                                     \
>> +            ok(buf[i] == special_expected[i],                               \
>> +               "buffer[%d] = 0x%x\n", i, buf[i]);                           \
>> +        for (; i < sizeof(buffer); i++)                                     \
>> +            ok(buf[i] == 0x55, "buffer[%d] = 0x%x\n", i, buf[i]);           \
>> +    } while (0)
> It's better to avoid large macros like this one. A common way to do that 
> is to move code to another function and call it with a single line 
> macro, for line information ok_() should be used.

Good point. Will fix, thanks.




More information about the wine-devel mailing list