480{
481 const char*
value=
"Long long value";
482 const char* not_an_env_var="%NotAnEnvVar%";
483 char buf[256], buf1[256], buf2[0x8000];
484 DWORD ret_size, ret_size1;
489 {
491 const char *expected_str;
492 int count_in;
493 int expected_count_out;
495 {
496 { "Long long value", "", 0, 17 },
497 { "Long long value", "", 1, 17 },
498 { "Long long value", "", 2, 17 },
499 { "Long long value", "", 3, 17 },
500 { "Long long value", "", 15, 17 },
501 { "Long long value", "", 16, 17 },
502 { "Long long value", "Long long value", 17, 16 },
503 { "%TVAR% long long", "", 0, 16 },
504 { "%TVAR% long long", "", 1, 16 },
505 { "%TVAR% long long", "", 2, 16 },
506 { "%TVAR% long long", "", 4, 16 },
507 { "%TVAR% long long", "", 5, 16 },
508 { "%TVAR% long long", "", 6, 16 },
509 { "%TVAR% long long", "", 7, 16 },
510 { "%TVAR% long long", "", 15, 16 },
511 { "%TVAR% long long", "WINE long long", 16, 15 },
512 { "%TVAR%%TVAR% long", "", 4, 15 },
513 { "%TVAR%%TVAR% long", "", 5, 15 },
514 { "%TVAR%%TVAR% long", "", 6, 15 },
515 { "%TVAR%%TVAR% long", "", 8, 15 },
516 { "%TVAR%%TVAR% long", "", 9, 15 },
517 { "%TVAR%%TVAR% long", "", 10, 15 },
518 { "%TVAR%%TVAR% long", "", 14, 15 },
519 { "%TVAR%%TVAR% long", "WINEWINE long", 15, 14 },
520 { "%TVAR% %TVAR% long", "", 5, 16 },
521 { "%TVAR% %TVAR% long", "", 6, 16 },
522 { "%TVAR% %TVAR% long", "", 8, 16 },
523 { "%TVAR% %TVAR% long", "", 9, 16 },
524 { "%TVAR% %TVAR% long", "", 10, 16 },
525 { "%TVAR% %TVAR% long", "", 11, 16 },
526 { "%TVAR% %TVAR% long", "", 12, 16 },
527 { "%TVAR% %TVAR% long", "", 14, 16 },
528 { "%TVAR% %TVAR% long", "", 15, 16 },
529 { "%TVAR% %TVAR% long", "WINE WINE long", 16, 15 },
530 { "%TVAR2% long long", "", 1, 19 },
531 { "%TVAR2% long long", "", 2, 19 },
532 { "%TVAR2% long long", "", 4, 19 },
533 { "%TVAR2% long long", "", 7, 19 },
534 { "%TVAR2% long long", "", 8, 19 },
535 { "%TVAR2% long long", "", 9, 19 },
536 { "%TVAR2% long long", "", 10, 19 },
537 { "%TVAR2% long long", "", 18, 19 },
538 { "%TVAR2% long long", "%TVAR2% long long", 19, 18 },
539 { "%TVAR long long", "", 1, 17 },
540 { "%TVAR long long", "", 2, 17 },
541 { "%TVAR long long", "", 3, 17 },
542 { "%TVAR long long", "", 15, 17 },
543 { "%TVAR long long", "", 16, 17 },
544 { "%TVAR long long", "%TVAR long long", 17, 16 },
545 };
546
548
550 ok(ret_size == 1 || ret_size == 0 || ret_size == 2 ,
551 "ExpandEnvironmentStrings returned %ld\n", ret_size);
552
553
559 ret_size == 0 ,
560 "ExpandEnvironmentStrings returned %ld instead of %d, %d or %d\n",
562
563
565
568 "ExpandEnvironmentStrings returned %ld instead of %d\n",
570
571
573
576 "ExpandEnvironmentStrings returned %ld instead of %d\n",
578
579
580
584 "ExpandEnvironmentStrings returned %ld instead of %d\n",
586 ok(!
strcmp(buf1,
value),
"ExpandEnvironmentStrings returned [%s]\n", buf1);
587
588
591 ok(ret_size ==
strlen(not_an_env_var)+1 ||
592 ret_size == (
strlen(not_an_env_var)+1)*2 ,
593 "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size,
lstrlenA(not_an_env_var)+1);
594 ok(!
strcmp(buf1, not_an_env_var),
"ExpandEnvironmentStrings returned [%s]\n", buf1);
595
596
599 ok(!
strcmp(
buf, buf2),
"ExpandEnvironmentStrings failed %s vs %s. ret_size = %ld\n",
buf, buf2, ret_size);
600
603 ok ((ret_size1 >0) && (ret_size1<256),
"GetWindowsDirectory Failed\n");
606 {
607 ok(!
strcmp(
buf, buf1),
"ExpandEnvironmentStrings failed %s vs %s. ret_size = %ld\n",
buf, buf1, ret_size);
608 }
609
610
612 strcpy(
buf,
"Indirect-%IndirectVar%-Indirect");
613 strcpy(buf2,
"Indirect-Foo%EnvVar%Bar-Indirect");
616 ret_size == (
strlen(buf2)+1)*2 ,
617 "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size,
lstrlenA(buf2)+1);
618 ok(!
strcmp(buf1, buf2),
"ExpandEnvironmentStrings returned [%s]\n", buf1);
620
622
625
630
632 {
634
638 ok(
ret ==
test->expected_count_out,
"Test %d: got %lu\n",
i,
ret);
641 }
642
645
647 {
648 const char *japanese_test = "\x88\xEA\x93\xF1\x8E\x4F\x8E\x6C\x8C\xDC\x98\x5A\x8E\xB5\x94\xAA\x8B\xE3";
649 int japanese_len =
strlen(japanese_test);
650
654 ok(ret_size >= japanese_len,
"Needed at least %d, got %lu\n", japanese_len, ret_size);
655
659 ok(ret_size >= japanese_len,
"Needed at least %d, got %lu\n", japanese_len, ret_size);
661
665 ok(ret_size >= japanese_len,
"Needed at least %d, got %lu\n", japanese_len, ret_size);
666 }
667 else
668 {
669 skip(
"Skipping japanese language tests\n");
670 }
671}
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int WINAPI lstrlenA(LPCSTR lpString)
static struct test_info tests[]
#define success(from, fromstr, to, tostr)