Hugh McMaster : reg/tests: Correctly import hex values with no data.
Module: wine Branch: master Commit: c02dd08f910fb684e88b02fcb9d75564c8636e5a URL: http://source.winehq.org/git/wine.git/?a=commit;h=c02dd08f910fb684e88b02fcb9... Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Oct 16 10:27:25 2017 +0000 reg/tests: Correctly import hex values with no data. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/import.c | 4 ++++ programs/reg/tests/reg.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/programs/reg/import.c b/programs/reg/import.c index d2b4cdc..8350fa7 100644 --- a/programs/reg/import.c +++ b/programs/reg/import.c @@ -785,6 +785,9 @@ static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos) { WCHAR *line = pos; + if (!*line) + goto set_value; + if (!convert_hex_csv_to_hex(parser, &line)) goto invalid; @@ -796,6 +799,7 @@ static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos) prepare_hex_string_data(parser); +set_value: set_state(parser, SET_VALUE); return line; diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 42e6a97..e0ff5f0 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -2322,10 +2322,10 @@ static void test_import(void) "\"Wine68i\"=hex(0):\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg(hkey, "Wine68a", REG_SZ, NULL, 0, 0); - verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, TODO_REG_SIZE); + verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, 0); verify_reg(hkey, "Wine68c", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine68d", REG_DWORD, NULL, 0, 0); - verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, TODO_REG_SIZE); + verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, 0); verify_reg(hkey, "Wine68f", 0x100, NULL, 0, 0); verify_reg(hkey, "Wine68g", 0xabcd, NULL, 0, 0); verify_reg(hkey, "Wine68h", REG_BINARY, NULL, 0, 0); @@ -3830,10 +3830,10 @@ static void test_unicode_import(void) "\"Wine68i\"=hex(0):\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg(hkey, "Wine68a", REG_SZ, NULL, 0, 0); - verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, TODO_REG_SIZE); + verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, 0); verify_reg(hkey, "Wine68c", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine68d", REG_DWORD, NULL, 0, 0); - verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, TODO_REG_SIZE); + verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, 0); verify_reg(hkey, "Wine68f", 0x100, NULL, 0, 0); verify_reg(hkey, "Wine68g", 0xabcd, NULL, 0, 0); verify_reg(hkey, "Wine68h", REG_BINARY, NULL, 0, 0);
participants (1)
-
Alexandre Julliard