-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-10-17 20:38, schrieb Jonathan Vollebregt:
- /* REG_MULTI_SZ */
- run_reg_exe("reg add HKCU\" KEY_BASE " /v multi0 /t REG_MULTI_SZ /d "three\0little\0strings" /f", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- memcpy(buffer, "three", 6);
- memcpy(buffer+6, "little", 7);
- memcpy(buffer+6+7, "strings", 8);
- buffer[21] = 0;
- verify_reg(hkey, "multi0", REG_MULTI_SZ, buffer, 22, TODO_REG_SIZE);
I think this shoudl work as well: const char buffer[] = "three\0little\0strings\0";
verify_reg(hkey, "multi0", REG_MULTI_SZ, buffer, sizeof(buffer), TODO_REG_SIZE);
Notice the [] to declare an array so sizeof returns the proper value. strlen will not work.
- run_reg_exe("reg add HKCU\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s "#randomgibberish" /d "three#little#strings" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg add HKCU\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s "" /d "three#little#strings" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg add HKCU\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s "#" /d "##" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg add HKCU\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s "#" /d "two##strings" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg add HKCU\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s "#" /d "#a" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
What about the following cases?
/s ABC /d threeABClittleABCstrings /s \0 /d three\0little\0strings
On 10/20/2014 04:42 PM, Stefan Dösinger wrote:
I think this shoudl work as well: const char buffer[] = "three\0little\0strings\0";
Then I'd get:
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
I could assign it at the start of the reg_add function but that seems a bit out of place and since the REG_BINARY tests reuse the buffer it's easier to have it non-const.
However, this did give me the idea of using:
memcpy(buffer, "three\0little\0strings\0", 22);
What about the following cases?
/s ABC /d threeABClittleABCstrings /s \0 /d three\0little\0strings
If the separator is more than one character native reg returns 1, though I haven't tested for the second case.
If you want to print the expected value I'd prefer something like this:
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u, expected %u\n", r, REG_EXIT_SUCCESS);
I'll change my patches to this. Should I expand the commit to change the existing tests as well?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-10-20 17:14, schrieb Jonathan Vollebregt:
I could assign it at the start of the reg_add function but that seems a bit out of place and since the REG_BINARY tests reuse the buffer it's easier to have it non-const.
However, this did give me the idea of using:
memcpy(buffer, "three\0little\0strings\0", 22);
That would work. IMHO using separate variables that are declared in a way that don't need magic sizes is nicer, but I'll leave this up to you. And I don't know what Alexandre prefers either way.
What about the following cases?
/s ABC /d threeABClittleABCstrings /s \0 /d three\0little\0strings
If the separator is more than one character native reg returns 1, though I haven't tested for the second case.
Afaics your tests don't distinguish between the case that the separator is more than one character and the case that the separator does not occur in the input value.
In other words, this needs another test: /s # /d onebigstring
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u, expected %u\n", r, REG_EXIT_SUCCESS);
I'll change my patches to this. Should I expand the commit to change the existing tests as well?
Yes please.
Thanks again for your work!
Stefan