Module: wine Branch: master Commit: ced6d4618be73182b5df5c54ee803283666662d8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ced6d4618be73182b5df5c54ee...
Author: Hugh McMaster hugh.mcmaster@outlook.com Date: Tue Dec 6 12:07:29 2016 +0000
regedit/tests: Move existing comment tests to a separate function.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/regedit/tests/regedit.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index 23ea4f9..54558b1 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -278,14 +278,6 @@ static void test_basic_import(void) verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0); todo_wine verify_reg(hkey, "Wine7", REG_SZ, "No newline", 11, 0);
- exec_import_str("REGEDIT4\n\n" - "[HKEY_CURRENT_USER\" KEY_BASE "]\n" - "#comment\\n" - ""Wine8"="Line 1"\n" - ";comment \\n" - ""Wine9"="Line 2"\n\n"); - verify_reg(hkey, "Wine8", REG_SZ, "Line 1", 7, 0); - verify_reg(hkey, "Wine9", REG_SZ, "Line 2", 7, 0); RegCloseKey(hkey);
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); @@ -344,6 +336,30 @@ static void test_invalid_import(void) ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); }
+static void test_comments(void) +{ + LONG lr; + HKEY hkey; + + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "]\n" + "#comment\\n" + ""Wine1"="Line 1"\n" + ";comment\\n" + ""Wine2"="Line 2"\n\n"); + lr = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + verify_reg(hkey, "Wine1", REG_SZ, "Line 1", 7, 0); + verify_reg(hkey, "Wine2", REG_SZ, "Line 2", 7, 0); + + RegCloseKey(hkey); + + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); +} + START_TEST(regedit) { WCHAR wchar_test[] = {0xFEFF,'W','i','n','d','o','w','s',' ','R','e','g', @@ -359,4 +375,5 @@ START_TEST(regedit)
test_basic_import(); test_invalid_import(); + test_comments(); }