Permalink
Browse files

windows: fix environment_creation test

abc945b fails environment_creation test
  • Loading branch information...
1 parent abc945b commit 09faee40eb6de13f115dfcae3305faa49f8d252f Shigeki Ohtsu committed with piscisaureus Aug 29, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 test/test-spawn.c
View
@@ -667,7 +667,7 @@ TEST_IMPL(argument_escaping) {
return 0;
}
-WCHAR* make_program_env(char** env_block);
+uv_err_t make_program_env(char** env_block, WCHAR** dst_ptr);
TEST_IMPL(environment_creation) {
int i;
@@ -682,8 +682,9 @@ TEST_IMPL(environment_creation) {
WCHAR expected[512];
WCHAR* ptr = expected;
- WCHAR* result;
+ uv_err_t result;
WCHAR* str;
+ WCHAR* env;
for (i = 0; i < sizeof(environment) / sizeof(environment[0]) - 1; i++) {
ptr += uv_utf8_to_utf16(environment[i], ptr, expected + sizeof(expected) - ptr);
@@ -700,13 +701,14 @@ TEST_IMPL(environment_creation) {
++ptr;
*ptr = '\0';
- result = make_program_env(environment);
+ result = make_program_env(environment, &env);
+ ASSERT(result.code == UV_OK);
- for (str = result; *str; str += wcslen(str) + 1) {
+ for (str = env; *str; str += wcslen(str) + 1) {
wprintf(L"%s\n", str);
}
- ASSERT(wcscmp(expected, result) == 0);
+ ASSERT(wcscmp(expected, env) == 0);
return 0;
}

0 comments on commit 09faee4

Please sign in to comment.