ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2022
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
236 discussions
Start a n
N
ew thread
[reactos] 118/158: [WINESYNC] reg: Remove two unused string resources.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2964cf3b371f24362085d…
commit 2964cf3b371f24362085db771f5ab66ac679c9fe Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:40:42 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Remove two unused string resources. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id e4f3d51fdde4b762d2317ce7b2aa140ac030989b by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- base/applications/cmdutils/reg/resource.h | 2 -- sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/base/applications/cmdutils/reg/resource.h b/base/applications/cmdutils/reg/resource.h index 68b8ef86920..b80b402fd17 100644 --- a/base/applications/cmdutils/reg/resource.h +++ b/base/applications/cmdutils/reg/resource.h @@ -47,7 +47,6 @@ #define STRING_DELETE_SUBKEY 122 #define STRING_INVALID_STRING 123 #define STRING_VALUEALL_FAILED 124 -#define STRING_GENERAL_FAILURE 125 #define STRING_MATCHES_FOUND 126 #define STRING_INVALID_SYNTAX 127 #define STRING_INVALID_OPTION 128 @@ -56,7 +55,6 @@ #define STRING_VALUE_NOT_SET 131 #define STRING_IMPORT_USAGE 132 #define STRING_FILE_NOT_FOUND 133 -#define STRING_OPEN_KEY_FAILED 134 #define STRING_ESCAPE_SEQUENCE 135 #define STRING_EXPORT_USAGE 136 #define STRING_INVALID_SYSTEM_KEY 137 diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 066ee20b473..b4d7e7adebb 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 6c466296a7629487930d4d6e4fa7d7ae66a7bf61 + wine: e4f3d51fdde4b762d2317ce7b2aa140ac030989b
2 years, 6 months
1
0
0
0
[reactos] 117/158: [WINESYNC] reg: Fail if one or more arguments follow a help switch.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67493a4006273804ece9d…
commit 67493a4006273804ece9d4c1ae2a939ed979cce3 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:22:50 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Fail if one or more arguments follow a help switch. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6c466296a7629487930d4d6e4fa7d7ae66a7bf61 by Hugh McMaster <hugh.mcmaster(a)outlook.com> manual adjustment needed --- base/applications/cmdutils/reg/reg.c | 13 ++++++++----- modules/rostests/winetests/reg/copy.c | 8 ++++---- sdk/tools/winesync/reg.cfg | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c index d4c915d5c6e..7099cba594e 100644 --- a/base/applications/cmdutils/reg/reg.c +++ b/base/applications/cmdutils/reg/reg.c @@ -349,14 +349,12 @@ int __cdecl wmain(int argc, WCHAR *argvW[]) return 1; } else if (argc == 2) /* Valid operation, no arguments supplied */ - { - output_message(STRING_INVALID_SYNTAX); - output_message(STRING_FUNC_HELP, _wcsupr(argvW[1])); - return 1; - } + goto invalid; if (is_help_switch(argvW[2])) { + if (argc > 3) goto invalid; + output_message(op_help); output_message(STRING_REG_VIEW_USAGE); return 0; @@ -378,4 +376,9 @@ int __cdecl wmain(int argc, WCHAR *argvW[]) return reg_import(argc, argvW); return reg_query(argc, argvW); + +invalid: + output_message(STRING_INVALID_SYNTAX); + output_message(STRING_FUNC_HELP, wcsupr(argvW[1])); + return 1; } diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index ecd3cc5b29d..5ddcc2c0ffa 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -37,16 +37,16 @@ static void test_command_syntax(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); run_reg_exe("reg copy /? /f", &r); - todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /h /f", &r); - todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /? /s", &r); - todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /h /s", &r); - todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /f", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index ce8560ddeb3..066ee20b473 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: ac32dd8abcdd93f5428ba93c8aff7f0bb5a7c2f2 + wine: 6c466296a7629487930d4d6e4fa7d7ae66a7bf61
2 years, 6 months
1
0
0
0
[reactos] 116/158: [WINESYNC] reg: Add initial support for the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=181292dc07b496aeaf4ba…
commit 181292dc07b496aeaf4ba9faa9be098b476f85bf Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Add initial support for the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ac32dd8abcdd93f5428ba93c8aff7f0bb5a7c2f2 by Hugh McMaster <hugh.mcmaster(a)outlook.com> manual adjustment needed --- base/applications/cmdutils/reg/copy.c | 24 ++++++++++++++++++++++++ base/applications/cmdutils/reg/lang/en-US.rc | 22 ++++++++++++++++++++++ base/applications/cmdutils/reg/reg.c | 6 ++++++ base/applications/cmdutils/reg/reg.h | 3 +++ base/applications/cmdutils/reg/resource.h | 1 + modules/rostests/winetests/reg/copy.c | 14 +++++++------- sdk/tools/winesync/reg.cfg | 2 +- 7 files changed, 64 insertions(+), 8 deletions(-) diff --git a/base/applications/cmdutils/reg/copy.c b/base/applications/cmdutils/reg/copy.c new file mode 100644 index 00000000000..ba0916e9956 --- /dev/null +++ b/base/applications/cmdutils/reg/copy.c @@ -0,0 +1,24 @@ +/* + * Copyright 2021 Hugh McMaster + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "reg.h" + +int reg_copy(int argc, WCHAR *argvW[]) +{ + return 1; +} diff --git a/base/applications/cmdutils/reg/lang/en-US.rc b/base/applications/cmdutils/reg/lang/en-US.rc index 2fb2c253aa6..612d4e15cf8 100644 --- a/base/applications/cmdutils/reg/lang/en-US.rc +++ b/base/applications/cmdutils/reg/lang/en-US.rc @@ -148,9 +148,31 @@ STRINGTABLE STRING_OVERWRITE_FILE, "The file '%1' already exists. Do you want to overwrite it?" STRING_KEY_NONEXIST, "reg: Unable to find the specified registry key\n" STRING_KEY_IMPORT_FAILED, "reg: Unable to import the registry key '%1'\n" + STRING_REG_VIEW_USAGE, " /reg:32\n\ \ Access the registry using the 32-bit view.\n\n\ \ /reg:64\n\ \ Access the registry using the 64-bit view.\n\n" STRING_ACCESS_DENIED, "reg: Unable to access or create the specified registry key\n" + + STRING_COPY_USAGE, "REG COPY <key1> <key2> [/s] [/f]\n\n\ +\ Copies the contents of a specified registry key to another location.\n\ +\ By default, this operation only copies registry values. Use [/s] to\n\ +\ recursively copy all subkeys and values.\n\n\ +\ <key1>, <key2>\n\ +\ Registry keys specifying the source (<key1>) and destination (<key2>)\n\ +\ of the data. If <key2> does not exist, it is created.\n\n\ +\ Format: ROOT\\Subkey\n\n\ +\ ROOT: A predefined registry key. This must be one of the following:\n\n\ +\ HKEY_LOCAL_MACHINE | HKLM\n\ +\ HKEY_CURRENT_USER | HKCU\n\ +\ HKEY_CLASSES_ROOT | HKCR\n\ +\ HKEY_USERS | HKU\n\ +\ HKEY_CURRENT_CONFIG | HKCC\n\n\ +\ Subkey: The full path to a registry key under a given ROOT key.\n\n\ +\ /s\n\ +\ Copy all subkeys and values from <key1> to <key2>.\n\n\ +\ /f\n\ +\ Overwrite all registry data in <key2> without prompting for confirmation.\n\ +\ This option does not modify subkeys and values that only exist in <key2>.\n\n" } diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c index 0938bffe53e..d4c915d5c6e 100644 --- a/base/applications/cmdutils/reg/reg.c +++ b/base/applications/cmdutils/reg/reg.c @@ -1,5 +1,6 @@ /* * Copyright 2008 Andrew Riedi + * Copyright 2016-2017, 2021 Hugh McMaster * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -285,6 +286,7 @@ static BOOL is_help_switch(const WCHAR *s) enum operations { REG_ADD, + REG_COPY, REG_DELETE, REG_EXPORT, REG_IMPORT, @@ -299,6 +301,7 @@ static enum operations get_operation(const WCHAR *str, int *op_help) static const struct op_info op_array[] = { { L"add", REG_ADD, STRING_ADD_USAGE }, + { L"copy", REG_COPY, STRING_COPY_USAGE }, { L"delete", REG_DELETE, STRING_DELETE_USAGE }, { L"export", REG_EXPORT, STRING_EXPORT_USAGE }, { L"import", REG_IMPORT, STRING_IMPORT_USAGE }, @@ -362,6 +365,9 @@ int __cdecl wmain(int argc, WCHAR *argvW[]) if (op == REG_ADD) return reg_add(argc, argvW); + if (op == REG_COPY) + return reg_copy(argc, argvW); + if (op == REG_DELETE) return reg_delete(argc, argvW); diff --git a/base/applications/cmdutils/reg/reg.h b/base/applications/cmdutils/reg/reg.h index b12d936d672..67b49b7797f 100644 --- a/base/applications/cmdutils/reg/reg.h +++ b/base/applications/cmdutils/reg/reg.h @@ -47,6 +47,9 @@ BOOL is_switch(const WCHAR *s, const WCHAR c); /* add.c */ int reg_add(int argc, WCHAR *argvW[]); +/* copy.c */ +int reg_copy(int argc, WCHAR *argvW[]); + /* delete.c */ int reg_delete(int argc, WCHAR *argvW[]); diff --git a/base/applications/cmdutils/reg/resource.h b/base/applications/cmdutils/reg/resource.h index 3dc103b56b9..68b8ef86920 100644 --- a/base/applications/cmdutils/reg/resource.h +++ b/base/applications/cmdutils/reg/resource.h @@ -65,3 +65,4 @@ #define STRING_KEY_IMPORT_FAILED 140 #define STRING_REG_VIEW_USAGE 141 #define STRING_ACCESS_DENIED 142 +#define STRING_COPY_USAGE 143 diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 53d990811ac..ecd3cc5b29d 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -28,25 +28,25 @@ static void test_command_syntax(void) ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /?", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); run_reg_exe("reg copy /h", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); run_reg_exe("reg copy -H", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); run_reg_exe("reg copy /? /f", &r); - ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /h /f", &r); - ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /? /s", &r); - ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /h /s", &r); - ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); run_reg_exe("reg copy /f", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 4379cb99a16..ce8560ddeb3 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 537cd26f7cf799bf51875d1bc4970ec79a1184a3 + wine: ac32dd8abcdd93f5428ba93c8aff7f0bb5a7c2f2
2 years, 6 months
1
0
0
0
[reactos] 115/158: [WINESYNC] reg: Fix a typo in a function definition.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f6fb1eb08163b840c18fe…
commit f6fb1eb08163b840c18fe2f36e6f40858d1cea04 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Fix a typo in a function definition. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 537cd26f7cf799bf51875d1bc4970ec79a1184a3 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- base/applications/cmdutils/reg/reg.h | 2 +- sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/applications/cmdutils/reg/reg.h b/base/applications/cmdutils/reg/reg.h index 3fc9e392d45..b12d936d672 100644 --- a/base/applications/cmdutils/reg/reg.h +++ b/base/applications/cmdutils/reg/reg.h @@ -45,7 +45,7 @@ BOOL is_char(const WCHAR s, const WCHAR c); BOOL is_switch(const WCHAR *s, const WCHAR c); /* add.c */ -int reg_add(int arc, WCHAR *argvW[]); +int reg_add(int argc, WCHAR *argvW[]); /* delete.c */ int reg_delete(int argc, WCHAR *argvW[]); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 172377fde56..4379cb99a16 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: ca57a86074e6109fcc2254e3d58ff225f4335236 + wine: 537cd26f7cf799bf51875d1bc4970ec79a1184a3
2 years, 6 months
1
0
0
0
[reactos] 114/158: [WINESYNC] reg/tests: Add key and value order tests for the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=552256c17b8bf69f7bbc7…
commit 552256c17b8bf69f7bbc76b9f836205172b26a1f Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg/tests: Add key and value order tests for the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ca57a86074e6109fcc2254e3d58ff225f4335236 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 52 +++++++++++++++++++++++++++++++ modules/rostests/winetests/reg/export.c | 24 +++++++------- modules/rostests/winetests/reg/reg_test.h | 2 ++ sdk/tools/winesync/reg.cfg | 2 +- 4 files changed, 67 insertions(+), 13 deletions(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 3ed75acad4d..53d990811ac 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -325,6 +325,56 @@ static void test_copy_complex_data(void) todo_wine ok(compare_export("file.reg", complex_data_test, 0), "compare_export() failed\n"); } +static void test_copy_key_order(void) +{ + HKEY hkey; + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + add_key(hkey, "Subkey2", NULL); + add_key(hkey, "Subkey1", NULL); + close_key(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); +} + +static void test_copy_value_order(void) +{ + HKEY hkey; + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + add_value(hkey, "Value 2", REG_SZ, "I was added first!", 19); + add_value(hkey, "Value 1", REG_SZ, "I was added second!", 20); + close_key(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", value_order_test, 0), "compare_export() failed\n"); +} + static void test_copy_hex_data(void) { HKEY hkey; @@ -498,6 +548,8 @@ START_TEST(copy) test_copy_empty_key(); test_copy_simple_data(); test_copy_complex_data(); + test_copy_key_order(); + test_copy_value_order(); test_copy_hex_data(); test_copy_embedded_null_values(); test_copy_slashes(); diff --git a/modules/rostests/winetests/reg/export.c b/modules/rostests/winetests/reg/export.c index be1d9ea4f86..1348b8eebdb 100644 --- a/modules/rostests/winetests/reg/export.c +++ b/modules/rostests/winetests/reg/export.c @@ -99,6 +99,18 @@ const char *complex_data_test = "@=dword:12345678\r\n" "\"43981\"=hex(abcd):56,61,6c,75,65,00\r\n\r\n"; +const char *key_order_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\r\n\r\n"; + +const char *value_order_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"Value 2\"=\"I was added first!\"\r\n" + "\"Value 1\"=\"I was added second!\"\r\n\r\n"; + const char *empty_hex_test = "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" @@ -164,18 +176,6 @@ static void test_export(void) HKEY hkey, subkey; BYTE hex[4], buffer[8]; - const char *key_order_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\r\n\r\n"; - - const char *value_order_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"Value 2\"=\"I was added first!\"\r\n" - "\"Value 1\"=\"I was added second!\"\r\n\r\n"; - delete_tree(HKEY_CURRENT_USER, KEY_BASE); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index 14636b4edc9..28e2d8e3abe 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -81,6 +81,8 @@ BOOL compare_export_(const char *file, unsigned line, const char *filename, extern const char *empty_key_test; extern const char *simple_data_test; extern const char *complex_data_test; +extern const char *key_order_test; +extern const char *value_order_test; extern const char *empty_hex_test; extern const char *empty_hex_test2; extern const char *hex_types_test; diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index df3d2fff4cf..172377fde56 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: baf0254bbb617c3b21c5b068e645615418a5be19 + wine: ca57a86074e6109fcc2254e3d58ff225f4335236
2 years, 6 months
1
0
0
0
[reactos] 113/158: [WINESYNC] reg/tests: Add more data tests for the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=927db6bec59db1beff0ce…
commit 927db6bec59db1beff0ce099d562acb8cac532e0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:35 2022 +0200 [WINESYNC] reg/tests: Add more data tests for the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id baf0254bbb617c3b21c5b068e645615418a5be19 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 93 +++++++++++++++++++++++++++++++ modules/rostests/winetests/reg/export.c | 58 +++++++++---------- modules/rostests/winetests/reg/reg_test.h | 3 + sdk/tools/winesync/reg.cfg | 2 +- 4 files changed, 126 insertions(+), 30 deletions(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 579d91a35ab..3ed75acad4d 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -395,6 +395,96 @@ static void test_copy_hex_data(void) todo_wine ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); } +static void test_copy_embedded_null_values(void) +{ + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" COPY_SRC "]\n" + "\"Wine4a\"=dword:00000005\n" + "\"Wine4b\"=hex(1):00,00,00,00,00,00,00,00\n" + "\"Wine4c\"=\"Value\"\n" + "\"Wine4d\"=hex(1):00,00,61,00,62,00,63,00\n" + "\"Wine4e\"=dword:00000100\n" + "\"Wine4f\"=hex(1):00,00,56,00,61,00,6c,00,75,00,65,00,00,00\n" + "\"Wine4g\"=\"Value2\"\n" + "\"Wine4h\"=hex(1):61,00,62,00,63,00,00,00, \\\n" + " 64,00,65,00,66,00,00,00\n\n", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n"); +} + +static void test_copy_slashes(void) +{ + HKEY hkey; + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + add_key(hkey, "
https://winehq.org
", NULL); + add_value(hkey, "count/up", REG_SZ, "one/two/three", 14); + add_value(hkey, "\\foo\\bar", REG_SZ, "", 1); + close_key(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", slashes_test, 0), "compare_export() failed\n"); +} + +static void test_copy_escaped_null_values(void) +{ + HKEY hkey; + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + add_value(hkey, "Wine5a", REG_SZ, "\\0", 3); + add_value(hkey, "Wine5b", REG_SZ, "\\0\\0", 5); + add_value(hkey, "Wine5c", REG_SZ, "Value1\\0", 9); + add_value(hkey, "Wine5d", REG_SZ, "Value2\\0\\0\\0\\0", 15); + add_value(hkey, "Wine5e", REG_SZ, "Value3\\0Value4", 15); + add_value(hkey, "Wine5f", REG_SZ, "\\0Value5", 9); + close_key(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", escaped_null_test, 0), "compare_export() failed\n"); + + delete_key(HKEY_CURRENT_USER, COPY_SRC); + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); +} + START_TEST(copy) { DWORD r; @@ -409,4 +499,7 @@ START_TEST(copy) test_copy_simple_data(); test_copy_complex_data(); test_copy_hex_data(); + test_copy_embedded_null_values(); + test_copy_slashes(); + test_copy_escaped_null_values(); } diff --git a/modules/rostests/winetests/reg/export.c b/modules/rostests/winetests/reg/export.c index 8ea9bda3f1c..be1d9ea4f86 100644 --- a/modules/rostests/winetests/reg/export.c +++ b/modules/rostests/winetests/reg/export.c @@ -125,6 +125,35 @@ const char *hex_types_test = "\"Wine3b\"=hex:12,34,56,78\r\n" "\"Wine3c\"=dword:10203040\r\n\r\n"; +const char *embedded_null_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"Wine4a\"=dword:00000005\r\n" + "\"Wine4b\"=\"\"\r\n" + "\"Wine4c\"=\"Value\"\r\n" + "\"Wine4d\"=\"\"\r\n" + "\"Wine4e\"=dword:00000100\r\n" + "\"Wine4f\"=\"\"\r\n" + "\"Wine4g\"=\"Value2\"\r\n" + "\"Wine4h\"=\"abc\"\r\n\r\n"; + +const char *slashes_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"count/up\"=\"one/two/three\"\r\n" + "\"\\\\foo\\\\bar\"=\"\"\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\r\n\r\n"; + +const char *escaped_null_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"Wine5a\"=\"\\\\0\"\r\n" + "\"Wine5b\"=\"\\\\0\\\\0\"\r\n" + "\"Wine5c\"=\"Value1\\\\0\"\r\n" + "\"Wine5d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\r\n" + "\"Wine5e\"=\"Value3\\\\0Value4\"\r\n" + "\"Wine5f\"=\"\\\\0Value5\"\r\n\r\n"; + /* Unit tests */ @@ -147,35 +176,6 @@ static void test_export(void) "\"Value 2\"=\"I was added first!\"\r\n" "\"Value 1\"=\"I was added second!\"\r\n\r\n"; - const char *embedded_null_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"Wine4a\"=dword:00000005\r\n" - "\"Wine4b\"=\"\"\r\n" - "\"Wine4c\"=\"Value\"\r\n" - "\"Wine4d\"=\"\"\r\n" - "\"Wine4e\"=dword:00000100\r\n" - "\"Wine4f\"=\"\"\r\n" - "\"Wine4g\"=\"Value2\"\r\n" - "\"Wine4h\"=\"abc\"\r\n\r\n"; - - const char *slashes_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"count/up\"=\"one/two/three\"\r\n" - "\"\\\\foo\\\\bar\"=\"\"\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\r\n\r\n"; - - const char *escaped_null_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"Wine5a\"=\"\\\\0\"\r\n" - "\"Wine5b\"=\"\\\\0\\\\0\"\r\n" - "\"Wine5c\"=\"Value1\\\\0\"\r\n" - "\"Wine5d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\r\n" - "\"Wine5e\"=\"Value3\\\\0Value4\"\r\n" - "\"Wine5f\"=\"\\\\0Value5\"\r\n\r\n"; - delete_tree(HKEY_CURRENT_USER, KEY_BASE); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index 40880fa6c0a..14636b4edc9 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -84,6 +84,9 @@ extern const char *complex_data_test; extern const char *empty_hex_test; extern const char *empty_hex_test2; extern const char *hex_types_test; +extern const char *slashes_test; +extern const char *embedded_null_test; +extern const char *escaped_null_test; /* import.c */ #define test_import_str(c,r) import_reg(__FILE__,__LINE__,c,FALSE,r) diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 08a12a7a123..df3d2fff4cf 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 3115276367e61f98436f8ba2feee9da491f7d69f + wine: baf0254bbb617c3b21c5b068e645615418a5be19
2 years, 6 months
1
0
0
0
[reactos] 112/158: [WINESYNC] reg/tests: Add complex data and hex type tests for the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6ae4684dca79f9dbf1b36…
commit 6ae4684dca79f9dbf1b36e139d6844fb80c7e52f Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:35 2022 +0200 [WINESYNC] reg/tests: Add complex data and hex type tests for the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3115276367e61f98436f8ba2feee9da491f7d69f by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 141 ++++++++++++++++++++++++++++++ modules/rostests/winetests/reg/export.c | 106 +++++++++++----------- modules/rostests/winetests/reg/reg_test.h | 4 + sdk/tools/winesync/reg.cfg | 2 +- 4 files changed, 199 insertions(+), 54 deletions(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 7126b00d50e..579d91a35ab 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -256,6 +256,145 @@ static void test_copy_simple_data(void) todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); } +static void test_copy_complex_data(void) +{ + HKEY hkey, subkey; + DWORD r, dword; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + + dword = 0x100; + add_value(hkey, "DWORD", REG_DWORD, &dword, sizeof(dword)); + add_value(hkey, "String", REG_SZ, "Your text here...", 18); + + add_key(hkey, "Subkey1", &subkey); + add_value(subkey, "Binary", REG_BINARY, "\x11\x22\x33\x44", 4); + add_value(subkey, "Undefined hex", 0x100, "%PATH%", 7); + close_key(subkey); + + add_key(hkey, "Subkey2a", &subkey); + add_value(subkey, "double\"quote", REG_SZ, "\"Hello, World!\"", 16); + dword = 0x8; + add_value(subkey, "single'quote", REG_DWORD, &dword, sizeof(dword)); + close_key(subkey); + + add_key(hkey, "Subkey2a\\Subkey2b", &subkey); + add_value(subkey, NULL, REG_SZ, "Default value name", 19); + add_value(subkey, "Multiple strings", REG_MULTI_SZ, "Line1\0Line2\0Line3\0", 19); + close_key(subkey); + + add_key(hkey, "Subkey3a", &subkey); + add_value(subkey, "Backslash", REG_SZ, "Use \\\\ to escape a backslash", 29); + close_key(subkey); + + add_key(hkey, "Subkey3a\\Subkey3b\\Subkey3c", &subkey); + add_value(subkey, "String expansion", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14); + add_value(subkey, "Zero data type", REG_NONE, "Value", 6); + close_key(subkey); + + add_key(hkey, "Subkey4", &subkey); + dword = 0x12345678; + add_value(subkey, NULL, REG_DWORD, &dword, sizeof(dword)); + add_value(subkey, "43981", 0xabcd, "Value", 6); + close_key(subkey); + + close_key(hkey); + + /* Copy values only */ + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + + /* Copy subkeys and values */ + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", complex_data_test, 0), "compare_export() failed\n"); +} + +static void test_copy_hex_data(void) +{ + HKEY hkey; + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + /* Try copying empty hex values */ + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + add_value(hkey, "Wine1a", REG_NONE, NULL, 0); + add_value(hkey, "Wine1b", REG_SZ, NULL, 0); + add_value(hkey, "Wine1c", REG_EXPAND_SZ, NULL, 0); + add_value(hkey, "Wine1d", REG_BINARY, NULL, 0); + add_value(hkey, "Wine1e", REG_DWORD, NULL, 0); + add_value(hkey, "Wine1f", REG_MULTI_SZ, NULL, 0); + add_value(hkey, "Wine1g", 0x100, NULL, 0); + add_value(hkey, "Wine1h", 0xabcd, NULL, 0); + close_key(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n"); + + delete_key(HKEY_CURRENT_USER, COPY_SRC); + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + /* Try copying after importing alternative registry data types */ + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" COPY_SRC "]\n" + "\"Wine2a\"=hex(1):\n" + "\"Wine2b\"=hex(3):\n" + "\"Wine2c\"=hex(4):\n\n", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n"); + + delete_key(HKEY_CURRENT_USER, COPY_SRC); + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + /* Try copying more complex hex data */ + test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" COPY_SRC "]\n" + "\"Wine3a\"=hex(1):56,00,61,00,6c,00,75,00,65,00,00,00\n" + "\"Wine3b\"=hex(3):12,34,56,78\n" + "\"Wine3c\"=hex(4):40,30,20,10\n\n", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); +} + START_TEST(copy) { DWORD r; @@ -268,4 +407,6 @@ START_TEST(copy) test_command_syntax(); test_copy_empty_key(); test_copy_simple_data(); + test_copy_complex_data(); + test_copy_hex_data(); } diff --git a/modules/rostests/winetests/reg/export.c b/modules/rostests/winetests/reg/export.c index d2598dd8d48..8ea9bda3f1c 100644 --- a/modules/rostests/winetests/reg/export.c +++ b/modules/rostests/winetests/reg/export.c @@ -73,6 +73,58 @@ const char *simple_data_test = "\"DWORD\"=dword:00000100\r\n" "\"String\"=\"Your text here...\"\r\n\r\n"; +const char *complex_data_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"DWORD\"=dword:00000100\r\n" + "\"String\"=\"Your text here...\"\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\r\n" + "\"Binary\"=hex:11,22,33,44\r\n" + "\"Undefined hex\"=hex(100):25,50,41,54,48,25,00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\r\n" + "\"double\\\"quote\"=\"\\\"Hello, World!\\\"\"\r\n" + "\"single'quote\"=dword:00000008\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a\\Subkey2b]\r\n" + "@=\"Default value name\"\r\n" + "\"Multiple strings\"=hex(7):4c,00,69,00,6e,00,65,00,31,00,00,00,4c,00,69,00,6e,\\\r\n" + " 00,65,00,32,00,00,00,4c,00,69,00,6e,00,65,00,33,00,00,00,00,00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a]\r\n" + "\"Backslash\"=\"Use \\\\\\\\ to escape a backslash\"\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a\\Subkey3b]\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a\\Subkey3b\\Subkey3c]\r\n" + "\"String expansion\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,25,00,50,\\\r\n" + " 00,41,00,54,00,48,00,25,00,00,00\r\n" + "\"Zero data type\"=hex(0):56,61,6c,75,65,00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4]\r\n" + "@=dword:12345678\r\n" + "\"43981\"=hex(abcd):56,61,6c,75,65,00\r\n\r\n"; + +const char *empty_hex_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"Wine1a\"=hex(0):\r\n" + "\"Wine1b\"=\"\"\r\n" + "\"Wine1c\"=hex(2):\r\n" + "\"Wine1d\"=hex:\r\n" + "\"Wine1e\"=hex(4):\r\n" + "\"Wine1f\"=hex(7):\r\n" + "\"Wine1g\"=hex(100):\r\n" + "\"Wine1h\"=hex(abcd):\r\n\r\n"; + +const char *empty_hex_test2 = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"Wine2a\"=\"\"\r\n" + "\"Wine2b\"=hex:\r\n" + "\"Wine2c\"=hex(4):\r\n\r\n"; + +const char *hex_types_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"Wine3a\"=\"Value\"\r\n" + "\"Wine3b\"=hex:12,34,56,78\r\n" + "\"Wine3c\"=dword:10203040\r\n\r\n"; + /* Unit tests */ @@ -83,32 +135,6 @@ static void test_export(void) HKEY hkey, subkey; BYTE hex[4], buffer[8]; - const char *complex_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"DWORD\"=dword:00000100\r\n" - "\"String\"=\"Your text here...\"\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\r\n" - "\"Binary\"=hex:11,22,33,44\r\n" - "\"Undefined hex\"=hex(100):25,50,41,54,48,25,00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\r\n" - "\"double\\\"quote\"=\"\\\"Hello, World!\\\"\"\r\n" - "\"single'quote\"=dword:00000008\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a\\Subkey2b]\r\n" - "@=\"Default value name\"\r\n" - "\"Multiple strings\"=hex(7):4c,00,69,00,6e,00,65,00,31,00,00,00,4c,00,69,00,6e,\\\r\n" - " 00,65,00,32,00,00,00,4c,00,69,00,6e,00,65,00,33,00,00,00,00,00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a]\r\n" - "\"Backslash\"=\"Use \\\\\\\\ to escape a backslash\"\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a\\Subkey3b]\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a\\Subkey3b\\Subkey3c]\r\n" - "\"String expansion\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,25,00,50,\\\r\n" - " 00,41,00,54,00,48,00,25,00,00,00\r\n" - "\"Zero data type\"=hex(0):56,61,6c,75,65,00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4]\r\n" - "@=dword:12345678\r\n" - "\"43981\"=hex(abcd):56,61,6c,75,65,00\r\n\r\n"; - const char *key_order_test = "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n" @@ -121,32 +147,6 @@ static void test_export(void) "\"Value 2\"=\"I was added first!\"\r\n" "\"Value 1\"=\"I was added second!\"\r\n\r\n"; - const char *empty_hex_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"Wine1a\"=hex(0):\r\n" - "\"Wine1b\"=\"\"\r\n" - "\"Wine1c\"=hex(2):\r\n" - "\"Wine1d\"=hex:\r\n" - "\"Wine1e\"=hex(4):\r\n" - "\"Wine1f\"=hex(7):\r\n" - "\"Wine1g\"=hex(100):\r\n" - "\"Wine1h\"=hex(abcd):\r\n\r\n"; - - const char *empty_hex_test2 = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"Wine2a\"=\"\"\r\n" - "\"Wine2b\"=hex:\r\n" - "\"Wine2c\"=hex(4):\r\n\r\n"; - - const char *hex_types_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"Wine3a\"=\"Value\"\r\n" - "\"Wine3b\"=hex:12,34,56,78\r\n" - "\"Wine3c\"=dword:10203040\r\n\r\n"; - const char *embedded_null_test = "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" @@ -286,7 +286,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", complex_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", complex_data_test, 0), "compare_export() failed\n"); delete_tree(HKEY_CURRENT_USER, KEY_BASE); /* Test the export order of registry keys */ diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index 3f4677a7a69..40880fa6c0a 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -80,6 +80,10 @@ BOOL compare_export_(const char *file, unsigned line, const char *filename, const char *expected, DWORD todo); extern const char *empty_key_test; extern const char *simple_data_test; +extern const char *complex_data_test; +extern const char *empty_hex_test; +extern const char *empty_hex_test2; +extern const char *hex_types_test; /* import.c */ #define test_import_str(c,r) import_reg(__FILE__,__LINE__,c,FALSE,r) diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 3f876bd0b5f..08a12a7a123 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 48cd2588be54f7ab659ae3733456c826101f4c27 + wine: 3115276367e61f98436f8ba2feee9da491f7d69f
2 years, 6 months
1
0
0
0
[reactos] 111/158: [WINESYNC] reg/tests: Add missing return code checks.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=105971e68ea7e727ed23f…
commit 105971e68ea7e727ed23f39b79c44cbd6e699dc5 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:35 2022 +0200 [WINESYNC] reg/tests: Add missing return code checks. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 48cd2588be54f7ab659ae3733456c826101f4c27 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/export.c | 2 ++ sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/reg/export.c b/modules/rostests/winetests/reg/export.c index 27d70b6a663..d2598dd8d48 100644 --- a/modules/rostests/winetests/reg/export.c +++ b/modules/rostests/winetests/reg/export.c @@ -335,6 +335,7 @@ static void test_export(void) "\"Wine2a\"=hex(1):\n" "\"Wine2b\"=hex(3):\n" "\"Wine2c\"=hex(4):\n\n", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey); verify_reg(hkey, "Wine2a", REG_SZ, NULL, 0, 0); verify_reg(hkey, "Wine2b", REG_BINARY, NULL, 0, 0); @@ -351,6 +352,7 @@ static void test_export(void) "\"Wine3a\"=hex(1):56,00,61,00,6c,00,75,00,65,00,00,00\n" "\"Wine3b\"=hex(3):12,34,56,78\n" "\"Wine3c\"=hex(4):40,30,20,10\n\n", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey); verify_reg(hkey, "Wine3a", REG_SZ, "Value", 6, 0); memcpy(hex, "\x12\x34\x56\x78", 4); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 1a439434dd5..3f876bd0b5f 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: bb609c6acbf53b822825e3077fe0996a85d5026d + wine: 48cd2588be54f7ab659ae3733456c826101f4c27
2 years, 6 months
1
0
0
0
[reactos] 110/158: [WINESYNC] reg/tests: Add data tests for the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d40c4ec10d0483810d2b1…
commit d40c4ec10d0483810d2b1f58f6cadb235f3ae3bf Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:18 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:35 2022 +0200 [WINESYNC] reg/tests: Add data tests for the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id bb609c6acbf53b822825e3077fe0996a85d5026d by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 136 ++++++++++++++++++++++++++++++ modules/rostests/winetests/reg/export.c | 30 +++---- modules/rostests/winetests/reg/reg_test.h | 7 ++ sdk/tools/winesync/reg.cfg | 2 +- 4 files changed, 159 insertions(+), 16 deletions(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 0d245dae4da..7126b00d50e 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -122,6 +122,140 @@ static void test_command_syntax(void) ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); } +static void test_copy_empty_key(void) +{ + DWORD r; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, NULL); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); +} + +static void test_copy_simple_data(void) +{ + HKEY hkey; + DWORD r, dword; + + delete_tree(HKEY_CURRENT_USER, COPY_SRC); + verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC); + + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + + dword = 0x100; + add_value(hkey, "DWORD", REG_DWORD, &dword, sizeof(dword)); + add_value(hkey, "String", REG_SZ, "Your text here...", 18); + close_key(hkey); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + + todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + + run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); +} + START_TEST(copy) { DWORD r; @@ -132,4 +266,6 @@ START_TEST(copy) } test_command_syntax(); + test_copy_empty_key(); + test_copy_simple_data(); } diff --git a/modules/rostests/winetests/reg/export.c b/modules/rostests/winetests/reg/export.c index daf42f66e3e..27d70b6a663 100644 --- a/modules/rostests/winetests/reg/export.c +++ b/modules/rostests/winetests/reg/export.c @@ -18,9 +18,8 @@ #include "reg_test.h" -#define compare_export(f,e,todo) compare_export_(__FILE__,__LINE__,f,e,todo) -static BOOL compare_export_(const char *file, unsigned line, const char *filename, - const char *expected, DWORD todo) +BOOL compare_export_(const char *file, unsigned line, const char *filename, + const char *expected, DWORD todo) { FILE *fp; long file_size; @@ -64,6 +63,17 @@ error: return FALSE; } +const char *empty_key_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n"; + +const char *simple_data_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" + "\"DWORD\"=dword:00000100\r\n" + "\"String\"=\"Your text here...\"\r\n\r\n"; + + /* Unit tests */ static void test_export(void) @@ -73,16 +83,6 @@ static void test_export(void) HKEY hkey, subkey; BYTE hex[4], buffer[8]; - const char *empty_key_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n"; - - const char *simple_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" - "\"DWORD\"=dword:00000100\r\n" - "\"String\"=\"Your text here...\"\r\n\r\n"; - const char *complex_test = "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n" @@ -243,12 +243,12 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", simple_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); /* Test whether a .reg file extension is required when exporting */ run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " foo /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("foo", simple_test, 0), "compare_export() failed\n"); + ok(compare_export("foo", simple_data_test, 0), "compare_export() failed\n"); /* Test registry export with a complex data structure */ add_key(hkey, "Subkey1", &subkey); diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index 6718e91096f..3f4677a7a69 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -74,6 +74,13 @@ void add_value_(const char *file, unsigned line, HKEY hkey, const char *name, #define delete_value(k,n) delete_value_(__FILE__,__LINE__,k,n) void delete_value_(const char *file, unsigned line, const HKEY hkey, const char *name); +/* export.c */ +#define compare_export(f,e,todo) compare_export_(__FILE__,__LINE__,f,e,todo) +BOOL compare_export_(const char *file, unsigned line, const char *filename, + const char *expected, DWORD todo); +extern const char *empty_key_test; +extern const char *simple_data_test; + /* import.c */ #define test_import_str(c,r) import_reg(__FILE__,__LINE__,c,FALSE,r) #define test_import_wstr(c,r) import_reg(__FILE__,__LINE__,c,TRUE,r) diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index caed52b5125..1a439434dd5 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: c0619c092962d1c14725ac6cdc84b8e80ecb09bc + wine: bb609c6acbf53b822825e3077fe0996a85d5026d
2 years, 6 months
1
0
0
0
[reactos] 109/158: [WINESYNC] reg/tests: Add further syntax tests for the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f27a0866a4b9742e70f82…
commit f27a0866a4b9742e70f823c2cf9f1a44aea20621 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Jan 16 21:21:17 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:35 2022 +0200 [WINESYNC] reg/tests: Add further syntax tests for the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id c0619c092962d1c14725ac6cdc84b8e80ecb09bc by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 27 +++++++++++++++++++++++++++ sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 31223a3d314..0d245dae4da 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -88,11 +88,38 @@ static void test_command_syntax(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC, &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" COPY_SRC, &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC "\\", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" COPY_SRC "\\", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC " /f", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" COPY_SRC " /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC "\\ /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" COPY_SRC "\\ /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC " /s /f", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" COPY_SRC " /s /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC "\\ /s /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" COPY_SRC "\\ /s /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); } START_TEST(copy) diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 74438397053..caed52b5125 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: fa4268dcbcfe0b1bcbe3adafb7e3dd542eb6d928 + wine: c0619c092962d1c14725ac6cdc84b8e80ecb09bc
2 years, 6 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
24
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Results per page:
10
25
50
100
200