[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [1/2] ntdll/tests: Add tests for RtlUnicodeToUTF8N.
From: Thomas Faber <thomas.faber () reactos ! org>
Date: 2014-03-29 18:33:19
Message-ID: 533711EF.1020403 () reactos ! org
[Download RAW message or body]
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.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic