Commit 2f4717de authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

comctl32/tests: Constify some string holding variables / fields.

parent 1dfc36c3
...@@ -30,33 +30,20 @@ ...@@ -30,33 +30,20 @@
static HWND parent_wnd, child1_wnd, child2_wnd; static HWND parent_wnd, child1_wnd, child2_wnd;
static INT notify_format; static INT notify_format;
static BOOL notify_query_received; static BOOL notify_query_received;
static WCHAR test_w[] = {'t', 'e', 's', 't', 0}; static const CHAR test_a[] = "test";
static CHAR test_a[] = {'t', 'e', 's', 't', 0}; static const WCHAR test_w[] = L"test";
/* Double zero so that it's safe to cast it to WCHAR * */ /* Double zero so that it's safe to cast it to WCHAR * */
static CHAR te_a[] = {'t', 'e', 0, 0}; static const CHAR te_a[] = {'t', 'e', 0, 0};
static WCHAR empty_w[] = {0}; static WCHAR empty_w[] = {0};
static CHAR empty_a[] = {0}; static CHAR empty_a[] = {0};
static CHAR large_a[] = "You should have received a copy of the GNU Lesser General Public License along with this ..."; static const CHAR large_a[] =
static WCHAR large_w[] = "You should have received a copy of the GNU Lesser General Public License along with this ...";
{ static const WCHAR large_w[] =
'Y', 'o', 'u', ' ', 's', 'h', 'o', 'u', 'l', 'd', ' ', 'h', 'a', 'v', 'e', ' ', 'r', 'e', 'c', 'e', 'i', 'v', 'e', L"You should have received a copy of the GNU Lesser General Public License along with this ...";
'd', ' ', 'a', ' ', 'c', 'o', 'p', 'y', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'G', 'N', 'U', ' ', 'L', 'e', 's', static const WCHAR large_truncated_65_w[65] =
's', 'e', 'r', ' ', 'G', 'e', 'n', 'e', 'r', 'a', 'l', ' ', 'P', 'u', 'b', 'l', 'i', 'c', ' ', 'L', 'i', 'c', 'e', L"You should have received a copy of the GNU Lesser General Public";
'n', 's', 'e', ' ', 'a', 'l', 'o', 'n', 'g', ' ', 'w', 'i', 't', 'h', ' ', 't', 'h', 'i', 's', ' ', '.', '.', '.', 0 static const WCHAR large_truncated_80_w[80] =
}; L"You should have received a copy of the GNU Lesser General Public License along w";
static WCHAR large_truncated_65_w[65] =
{
'Y', 'o', 'u', ' ', 's', 'h', 'o', 'u', 'l', 'd', ' ', 'h', 'a', 'v', 'e', ' ', 'r', 'e', 'c', 'e', 'i', 'v',
'e', 'd', ' ', 'a', ' ', 'c', 'o', 'p', 'y', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'G', 'N', 'U', ' ', 'L',
'e', 's', 's', 'e', 'r', ' ', 'G', 'e', 'n', 'e', 'r', 'a', 'l', ' ', 'P', 'u', 'b', 'l', 'i', 'c', 0
};
static WCHAR large_truncated_80_w[80] =
{
'Y', 'o', 'u', ' ', 's', 'h', 'o', 'u', 'l', 'd', ' ', 'h', 'a', 'v', 'e', ' ', 'r', 'e', 'c', 'e',
'i', 'v', 'e', 'd', ' ', 'a', ' ', 'c', 'o', 'p', 'y', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'G',
'N', 'U', ' ', 'L', 'e', 's', 's', 'e', 'r', ' ', 'G', 'e', 'n', 'e', 'r', 'a', 'l', ' ', 'P', 'u',
'b', 'l', 'i', 'c', ' ', 'L', 'i', 'c', 'e', 'n', 's', 'e', ' ', 'a', 'l', 'o', 'n', 'g', ' ', 'w'
};
static WCHAR buffer[64]; static WCHAR buffer[64];
/* Text field conversion test behavior flags. */ /* Text field conversion test behavior flags. */
...@@ -96,26 +83,26 @@ static struct notify_test_info ...@@ -96,26 +83,26 @@ static struct notify_test_info
struct notify_test_send struct notify_test_send
{ {
/* Data sent to pager */ /* Data sent to pager */
WCHAR *send_text; const WCHAR *send_text;
INT send_text_size; INT send_text_size;
INT send_text_max; INT send_text_max;
/* Data expected by parent of pager */ /* Data expected by parent of pager */
void *expect_text; const void *expect_text;
}; };
struct notify_test_receive struct notify_test_receive
{ {
/* Data sent to pager */ /* Data sent to pager */
WCHAR *send_text; const WCHAR *send_text;
INT send_text_size; INT send_text_size;
INT send_text_max; INT send_text_max;
/* Data for parent to write */ /* Data for parent to write */
CHAR *write_pointer; const CHAR *write_pointer;
CHAR *write_text; const CHAR *write_text;
INT write_text_size; INT write_text_size;
INT write_text_max; INT write_text_max;
/* Data when message returned */ /* Data when message returned */
void *return_text; const void *return_text;
INT return_text_max; INT return_text_max;
}; };
...@@ -161,21 +148,21 @@ static const struct notify_test_receive test_dont_convert_receive_data[] = ...@@ -161,21 +148,21 @@ static const struct notify_test_receive test_dont_convert_receive_data[] =
static const struct notify_test_tooltip static const struct notify_test_tooltip
{ {
/* Data for parent to write */ /* Data for parent to write */
CHAR *write_sztext; const CHAR *write_sztext;
INT write_sztext_size; INT write_sztext_size;
CHAR *write_lpsztext; const CHAR *write_lpsztext;
HMODULE write_hinst; HMODULE write_hinst;
/* Data when message returned */ /* Data when message returned */
WCHAR *return_sztext; const WCHAR *return_sztext;
INT return_sztext_size; INT return_sztext_size;
WCHAR *return_lpsztext; const WCHAR *return_lpsztext;
HMODULE return_hinst; HMODULE return_hinst;
/* Data expected by parent */ /* Data expected by parent */
CHAR *expect_sztext; const CHAR *expect_sztext;
/* Data send to parent */ /* Data send to parent */
WCHAR *send_sztext; const WCHAR *send_sztext;
INT send_sztext_size; INT send_sztext_size;
WCHAR *send_lpsztext; const WCHAR *send_lpsztext;
} test_tooltip_data[] = } test_tooltip_data[] =
{ {
{NULL, 0, NULL, NULL, empty_w, -1, empty_w}, {NULL, 0, NULL, NULL, empty_w, -1, empty_w},
...@@ -193,17 +180,17 @@ static const struct notify_test_tooltip ...@@ -193,17 +180,17 @@ static const struct notify_test_tooltip
static const struct notify_test_datetime_format static const struct notify_test_datetime_format
{ {
/* Data send to parent */ /* Data send to parent */
WCHAR *send_pszformat; const WCHAR *send_pszformat;
/* Data expected by parent */ /* Data expected by parent */
CHAR *expect_pszformat; const CHAR *expect_pszformat;
/* Data for parent to write */ /* Data for parent to write */
CHAR *write_szdisplay; const CHAR *write_szdisplay;
INT write_szdisplay_size; INT write_szdisplay_size;
CHAR *write_pszdisplay; const CHAR *write_pszdisplay;
/* Data when message returned */ /* Data when message returned */
WCHAR *return_szdisplay; const WCHAR *return_szdisplay;
INT return_szdisplay_size; INT return_szdisplay_size;
WCHAR *return_pszdisplay; const WCHAR *return_pszdisplay;
} test_datetime_format_data[] = } test_datetime_format_data[] =
{ {
{test_w, test_a}, {test_w, test_a},
...@@ -658,7 +645,7 @@ static void notify_generic_text_handler(CHAR **text, INT *text_max) ...@@ -658,7 +645,7 @@ static void notify_generic_text_handler(CHAR **text, INT *text_max)
else if(notify_test_info.unicode == HDN_GETDISPINFOW) else if(notify_test_info.unicode == HDN_GETDISPINFOW)
*text = heap_strdup(receive_data->write_pointer); *text = heap_strdup(receive_data->write_pointer);
else else
*text = receive_data->write_pointer; *text = (char *)receive_data->write_pointer;
if (text_max && receive_data->write_text_max != -1) *text_max = receive_data->write_text_max; if (text_max && receive_data->write_text_max != -1) *text_max = receive_data->write_text_max;
break; break;
} }
...@@ -682,7 +669,7 @@ static void notify_tooltip_handler(NMTTDISPINFOA *nm) ...@@ -682,7 +669,7 @@ static void notify_tooltip_handler(NMTTDISPINFOA *nm)
ok(!lstrcmpA(data->expect_sztext, nm->szText), "Sub test %d expect %s, got %s\n", notify_test_info.sub_test_id, ok(!lstrcmpA(data->expect_sztext, nm->szText), "Sub test %d expect %s, got %s\n", notify_test_info.sub_test_id,
data->expect_sztext, nm->szText); data->expect_sztext, nm->szText);
if (data->write_sztext) memcpy(nm->szText, data->write_sztext, data->write_sztext_size); if (data->write_sztext) memcpy(nm->szText, data->write_sztext, data->write_sztext_size);
if (data->write_lpsztext) nm->lpszText = data->write_lpsztext; if (data->write_lpsztext) nm->lpszText = (char *)data->write_lpsztext;
if (data->write_hinst) nm->hinst = data->write_hinst; if (data->write_hinst) nm->hinst = data->write_hinst;
} }
...@@ -1106,8 +1093,8 @@ static void test_wm_notify_header(HWND pager) ...@@ -1106,8 +1093,8 @@ static void test_wm_notify_header(HWND pager)
HD_TEXTFILTERW hdtf = {0}; HD_TEXTFILTERW hdtf = {0};
hdi.mask = HDI_TEXT | HDI_FILTER; hdi.mask = HDI_TEXT | HDI_FILTER;
hdi.pszText = test_w; hdi.pszText = (WCHAR *)test_w;
hdtf.pszText = test_w; hdtf.pszText = (WCHAR *)test_w;
nmh.pitem = &hdi; nmh.pitem = &hdi;
nmh.pitem->pvFilter = &hdtf; nmh.pitem->pvFilter = &hdtf;
send_notify(pager, HDN_BEGINDRAG, HDN_BEGINDRAG, (LPARAM)&nmh, TRUE); send_notify(pager, HDN_BEGINDRAG, HDN_BEGINDRAG, (LPARAM)&nmh, TRUE);
...@@ -1142,7 +1129,7 @@ static void test_wm_notify_tooltip(HWND pager) ...@@ -1142,7 +1129,7 @@ static void test_wm_notify_tooltip(HWND pager)
memset(&nmttdi, 0, sizeof(nmttdi)); memset(&nmttdi, 0, sizeof(nmttdi));
if (data->send_sztext) memcpy(nmttdi.szText, data->send_sztext, data->send_sztext_size); if (data->send_sztext) memcpy(nmttdi.szText, data->send_sztext, data->send_sztext_size);
if (data->send_lpsztext) nmttdi.lpszText = data->send_lpsztext; if (data->send_lpsztext) nmttdi.lpszText = (WCHAR *)data->send_lpsztext;
send_notify(pager, TTN_GETDISPINFOW, TTN_GETDISPINFOA, (LPARAM)&nmttdi, FALSE); send_notify(pager, TTN_GETDISPINFOW, TTN_GETDISPINFOA, (LPARAM)&nmttdi, FALSE);
if (data->return_sztext) if (data->return_sztext)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment