ReactOS 0.4.15-dev-5672-gf73ac17
path.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "shlwapi.h"
#include "wininet.h"
Include dependency graph for path.c:

Go to the source code of this file.

Macros

#define LONG_LEN   (MAX_PATH * 2)
 
#define HALF_LEN   (MAX_PATH / 2 + 1)
 

Functions

static BOOL (WINAPI *pPathIsValidCharA)(char
 
static LPWSTR (WINAPI *pPathCombineW)(LPWSTR
 
static HRESULT (WINAPI *pPathCreateFromUrlA)(LPCSTR
 
static LPWSTR GetWideString (const char *src)
 
static void FreeWideString (LPWSTR wszString)
 
static LPSTR strdupA (LPCSTR p)
 
static void test_PathSearchAndQualify (void)
 
static void test_PathCreateFromUrl (void)
 
static void test_PathIsUrl (void)
 
static void test_PathIsValidCharA (void)
 
static void test_PathIsValidCharW (void)
 
static void test_PathMakePretty (void)
 
static void test_PathMatchSpec (void)
 
static void test_PathCombineW (void)
 
static void test_PathCombineA (void)
 
static void test_PathAddBackslash (void)
 
static void test_PathAppendA (void)
 
static void test_PathCanonicalizeA (void)
 
static void test_PathFindExtensionA (void)
 
static void test_PathBuildRootA (void)
 
static void test_PathCommonPrefixA (void)
 
static void test_PathUnquoteSpaces (void)
 
static void test_PathGetDriveNumber (void)
 
static void test_PathUnExpandEnvStrings (void)
 
static void test_PathIsRelativeA (void)
 
static void test_PathIsRelativeW (void)
 
static void test_PathStripPathA (void)
 
 START_TEST (path)
 

Variables

static DWORD
 
static LPCWSTR
 
static LPSTR
 
static LPDWORD
 
static LPWSTR
 
static LPCSTR
 
static UINT
 
struct {
   const char *   url
 
   const char *   path
 
   DWORD   ret
 
   DWORD   todo
 
TEST_PATHFROMURL []
 
struct {
   const char *   path
 
   BOOL   expect
 
TEST_PATH_IS_URL []
 
struct {
   const char *   path
 
   const char *   result
 
TEST_PATH_UNQUOTE_SPACES []
 
static const DWORD SHELL_charclass []
 
struct {
   const char *   path
 
   BOOL   expect
 
test_path_is_relative []
 

Macro Definition Documentation

◆ HALF_LEN

#define HALF_LEN   (MAX_PATH / 2 + 1)

Definition at line 556 of file path.c.

◆ LONG_LEN

#define LONG_LEN   (MAX_PATH * 2)

Definition at line 555 of file path.c.

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pPathIsValidCharA)
static

◆ FreeWideString()

static void FreeWideString ( LPWSTR  wszString)
static

Definition at line 200 of file path.c.

201{
202 HeapFree(GetProcessHeap(), 0, wszString);
203}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by test_PathCreateFromUrl(), test_PathIsRelativeW(), and test_PathUnquoteSpaces().

◆ GetWideString()

static LPWSTR GetWideString ( const char src)
static

Definition at line 186 of file path.c.

187{
188 WCHAR *ret;
189
190 if (!src)
191 return NULL;
192
194
196
197 return ret;
198}
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
GLenum src
Definition: glext.h:6340
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_PathCreateFromUrl(), test_PathIsRelativeW(), and test_PathUnquoteSpaces().

◆ HRESULT()

static HRESULT ( WINAPI pPathCreateFromUrlA)
static

◆ LPWSTR()

static LPWSTR ( WINAPI pPathCombineW)
static

◆ START_TEST()

START_TEST ( path  )

Definition at line 1675 of file path.c.

1676{
1677 HMODULE hShlwapi = GetModuleHandleA("shlwapi.dll");
1678
1679 /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */
1680 if(!GetProcAddress(hShlwapi, "SHCreateStreamOnFileEx")){
1681 win_skip("Too old shlwapi version\n");
1682 return;
1683 }
1684
1685 pPathCreateFromUrlA = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlA");
1686 pPathCreateFromUrlW = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlW");
1687 pPathCreateFromUrlAlloc = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlAlloc");
1688 pPathCombineW = (void*)GetProcAddress(hShlwapi, "PathCombineW");
1689 pPathIsValidCharA = (void*)GetProcAddress(hShlwapi, (LPSTR)455);
1690 pPathIsValidCharW = (void*)GetProcAddress(hShlwapi, (LPSTR)456);
1691 pPathAppendA = (void*)GetProcAddress(hShlwapi, "PathAppendA");
1692 pPathUnExpandEnvStringsA = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsA");
1693 pPathUnExpandEnvStringsW = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsW");
1694 pPathIsRelativeA = (void*)GetProcAddress(hShlwapi, "PathIsRelativeA");
1695 pPathIsRelativeW = (void*)GetProcAddress(hShlwapi, "PathIsRelativeW");
1696
1700
1704
1707
1721}
static HMODULE hShlwapi
Definition: clsid.c:38
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
static void test_PathGetDriveNumber(void)
Definition: path.c:1426
static void test_PathAppendA(void)
Definition: path.c:815
static void test_PathCommonPrefixA(void)
Definition: path.c:1192
static void test_PathStripPathA(void)
Definition: path.c:1662
static void test_PathUnExpandEnvStrings(void)
Definition: path.c:1461
static void test_PathUnquoteSpaces(void)
Definition: path.c:1403
static void test_PathFindExtensionA(void)
Definition: path.c:1070
static void test_PathCreateFromUrl(void)
Definition: path.c:266
static void test_PathSearchAndQualify(void)
Definition: path.c:216
static void test_PathBuildRootA(void)
Definition: path.c:1136
static void test_PathCombineW(void)
Definition: path.c:503
static void test_PathIsRelativeW(void)
Definition: path.c:1638
static void test_PathMatchSpec(void)
Definition: path.c:471
static void test_PathIsRelativeA(void)
Definition: path.c:1619
static void test_PathAddBackslash(void)
Definition: path.c:753
static void test_PathIsValidCharA(void)
Definition: path.c:397
static void test_PathCombineA(void)
Definition: path.c:558
static void test_PathMakePretty(void)
Definition: path.c:448
static void test_PathIsValidCharW(void)
Definition: path.c:424
static void test_PathCanonicalizeA(void)
Definition: path.c:942
static void test_PathIsUrl(void)
Definition: path.c:348
#define win_skip
Definition: test.h:160
char * LPSTR
Definition: xmlstorage.h:182

◆ strdupA()

static LPSTR strdupA ( LPCSTR  p)
static

Definition at line 205 of file path.c.

206{
207 LPSTR ret;
208 DWORD len = (strlen(p) + 1);
210 memcpy(ret, p, len);
211 return ret;
212}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by test_PathUnquoteSpaces().

◆ test_PathAddBackslash()

static void test_PathAddBackslash ( void  )
static

Definition at line 753 of file path.c.

754{
755 LPSTR str;
756 char path[MAX_PATH];
757 char too_long[LONG_LEN];
758
759 /* try a NULL path */
760 SetLastError(0xdeadbeef);
762 ok(str == NULL, "Expected str == NULL, got %p\n", str);
763 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
764
765 /* try an empty path */
766 path[0] = '\0';
767 SetLastError(0xdeadbeef);
769 ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
770 ok(!path[0], "Expected empty string, got %i\n", lstrlenA(path));
771 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
772
773 /* try a relative path */
774 lstrcpyA(path, "one\\two");
775 SetLastError(0xdeadbeef);
777 ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
778 ok(!lstrcmpA(path, "one\\two\\"), "Expected one\\two\\, got %s\n", path);
779 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
780
781 /* try periods */
782 lstrcpyA(path, "one\\..\\two");
783 SetLastError(0xdeadbeef);
785 ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
786 ok(!lstrcmpA(path, "one\\..\\two\\"), "Expected one\\..\\two\\, got %s\n", path);
787 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
788
789 /* try just a space */
790 lstrcpyA(path, " ");
791 SetLastError(0xdeadbeef);
793 ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
794 ok(!lstrcmpA(path, " \\"), "Expected \\, got %s\n", path);
795 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
796
797 /* path already has backslash */
798 lstrcpyA(path, "C:\\one\\");
799 SetLastError(0xdeadbeef);
801 ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
802 ok(!lstrcmpA(path, "C:\\one\\"), "Expected C:\\one\\, got %s\n", path);
803 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
804
805 memset(too_long, 'a', LONG_LEN);
806 too_long[LONG_LEN - 1] = '\0';
807
808 /* path is longer than MAX_PATH */
809 SetLastError(0xdeadbeef);
810 str = PathAddBackslashA(too_long);
811 ok(str == NULL, "Expected str == NULL, got %p\n", str);
812 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
813}
#define ok(value,...)
Definition: atltest.h:57
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
Definition: path.c:263
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define LONG_LEN
Definition: path.c:555
const WCHAR * str
#define memset(x, y, z)
Definition: compat.h:39
DWORD WINAPI GetLastError(void)
Definition: except.c:1040

Referenced by START_TEST().

◆ test_PathAppendA()

static void test_PathAppendA ( void  )
static

Definition at line 815 of file path.c.

816{
817 char path[MAX_PATH];
818 char too_long[LONG_LEN];
819 char half[HALF_LEN];
820 BOOL res;
821
822 lstrcpyA(path, "C:\\one");
823
824 /* try NULL pszMore */
825 SetLastError(0xdeadbeef);
827 ok(!res, "Expected failure\n");
828 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
829 ok(!lstrcmpA(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
830
831 /* try empty pszMore */
832 SetLastError(0xdeadbeef);
833 res = PathAppendA(path, "");
834 ok(res, "Expected success\n");
835 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
836 ok(!lstrcmpA(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
837
838 /* try NULL pszPath */
839 SetLastError(0xdeadbeef);
840 res = PathAppendA(NULL, "two\\three");
841 ok(!res, "Expected failure\n");
842 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
843
844 /* try empty pszPath */
845 path[0] = '\0';
846 SetLastError(0xdeadbeef);
847 res = PathAppendA(path, "two\\three");
848 ok(res, "Expected success\n");
849 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
850 ok(!lstrcmpA(path, "two\\three"), "Expected \\two\\three, got %s\n", path);
851
852 /* try empty pszPath and empty pszMore */
853 path[0] = '\0';
854 SetLastError(0xdeadbeef);
855 res = PathAppendA(path, "");
856 ok(res, "Expected success\n");
857 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
858 ok(!lstrcmpA(path, "\\"), "Expected \\, got %s\n", path);
859
860 /* try legit params */
861 lstrcpyA(path, "C:\\one");
862 SetLastError(0xdeadbeef);
863 res = PathAppendA(path, "two\\three");
864 ok(res, "Expected success\n");
865 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
866 ok(!lstrcmpA(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
867
868 /* try pszPath with backslash after it */
869 lstrcpyA(path, "C:\\one\\");
870 SetLastError(0xdeadbeef);
871 res = PathAppendA(path, "two\\three");
872 ok(res, "Expected success\n");
873 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
874 ok(!lstrcmpA(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
875
876 /* try pszMore with backslash before it */
877 lstrcpyA(path, "C:\\one");
878 SetLastError(0xdeadbeef);
879 res = PathAppendA(path, "\\two\\three");
880 ok(res, "Expected success\n");
881 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
882 ok(!lstrcmpA(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
883
884 /* try pszMore with backslash after it */
885 lstrcpyA(path, "C:\\one");
886 SetLastError(0xdeadbeef);
887 res = PathAppendA(path, "two\\three\\");
888 ok(res, "Expected success\n");
889 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
890 ok(!lstrcmpA(path, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", path);
891
892 /* try spaces in pszPath */
893 lstrcpyA(path, "C: \\ one ");
894 SetLastError(0xdeadbeef);
895 res = PathAppendA(path, "two\\three");
896 ok(res, "Expected success\n");
897 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
898 ok(!lstrcmpA(path, "C: \\ one \\two\\three"), "Expected C: \\ one \\two\\three, got %s\n", path);
899
900 /* try spaces in pszMore */
901 lstrcpyA(path, "C:\\one");
902 SetLastError(0xdeadbeef);
903 res = PathAppendA(path, " two \\ three ");
904 ok(res, "Expected success\n");
905 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
906 ok(!lstrcmpA(path, "C:\\one\\ two \\ three "), "Expected 'C:\\one\\ two \\ three ', got %s\n", path);
907
908 /* pszPath is too long */
909 memset(too_long, 'a', LONG_LEN);
910 too_long[LONG_LEN - 1] = '\0';
911 SetLastError(0xdeadbeef);
912 res = PathAppendA(too_long, "two\\three");
913 ok(!res, "Expected failure\n");
914 todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
915 ok(!too_long[0] || broken(lstrlenA(too_long) == (LONG_LEN - 1)), /* Win95 and some W2K */
916 "Expected length of too_long to be zero, got %i\n", lstrlenA(too_long));
917
918 /* pszMore is too long */
919 lstrcpyA(path, "C:\\one");
920 memset(too_long, 'a', LONG_LEN);
921 too_long[LONG_LEN - 1] = '\0';
922 SetLastError(0xdeadbeef);
923 res = PathAppendA(path, too_long);
924 ok(!res, "Expected failure\n");
925 todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
926 ok(!path[0] || broken(!lstrcmpA(path, "C:\\one")), /* Win95 and some W2K */
927 "Expected length of path to be zero, got %i\n", lstrlenA(path));
928
929 /* both params combined are too long */
930 memset(path, 'a', HALF_LEN);
931 path[HALF_LEN - 1] = '\0';
932 memset(half, 'b', HALF_LEN);
933 half[HALF_LEN - 1] = '\0';
934 SetLastError(0xdeadbeef);
935 res = PathAppendA(path, half);
936 ok(!res, "Expected failure\n");
937 ok(!path[0] || broken(lstrlenA(path) == (HALF_LEN - 1)), /* Win95 and some W2K */
938 "Expected length of path to be zero, got %i\n", lstrlenA(path));
939 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
940}
#define broken(x)
Definition: _sntprintf.h:21
BOOL WINAPI PathAppendA(LPSTR lpszPath, LPCSTR lpszAppend)
Definition: path.c:106
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
#define todo_wine
Definition: custom.c:79
#define HALF_LEN
Definition: path.c:556

Referenced by START_TEST().

◆ test_PathBuildRootA()

static void test_PathBuildRootA ( void  )
static

Definition at line 1136 of file path.c.

1137{
1138 LPSTR root;
1139 char path[10];
1140 char root_expected[26][4];
1141 char drive;
1142 int j;
1143
1144 /* set up the expected paths */
1145 for (drive = 'A'; drive <= 'Z'; drive++)
1146 sprintf(root_expected[drive - 'A'], "%c:\\", drive);
1147
1148 /* test the expected values */
1149 for (j = 0; j < 26; j++)
1150 {
1151 SetLastError(0xdeadbeef);
1152 lstrcpyA(path, "aaaaaaaaa");
1154 ok(root == path, "Expected root == path, got %p\n", root);
1155 ok(!lstrcmpA(root, root_expected[j]), "Expected %s, got %s\n", root_expected[j], root);
1156 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1157 }
1158
1159 /* test a negative drive number */
1160 SetLastError(0xdeadbeef);
1161 lstrcpyA(path, "aaaaaaaaa");
1162 root = PathBuildRootA(path, -1);
1163 ok(root == path, "Expected root == path, got %p\n", root);
1164 ok(!lstrcmpA(path, "aaaaaaaaa") || !path[0], /* Vista */
1165 "Expected aaaaaaaaa or empty string, got %s\n", path);
1166 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1167
1168 /* test a drive number greater than 25 */
1169 SetLastError(0xdeadbeef);
1170 lstrcpyA(path, "aaaaaaaaa");
1171 root = PathBuildRootA(path, 26);
1172 ok(root == path, "Expected root == path, got %p\n", root);
1173 ok(!lstrcmpA(path, "aaaaaaaaa") || !path[0], /* Vista */
1174 "Expected aaaaaaaaa or empty string, got %s\n", path);
1175 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1176
1177 /* length of path is less than 4 */
1178 SetLastError(0xdeadbeef);
1179 lstrcpyA(path, "aa");
1180 root = PathBuildRootA(path, 0);
1181 ok(root == path, "Expected root == path, got %p\n", root);
1182 ok(!lstrcmpA(path, "A:\\"), "Expected A:\\, got %s\n", path);
1183 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1184
1185 /* path is NULL */
1186 SetLastError(0xdeadbeef);
1187 root = PathBuildRootA(NULL, 0);
1188 ok(root == NULL, "Expected root == NULL, got %p\n", root);
1189 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1190}
struct _root root
LPSTR WINAPI PathBuildRootA(LPSTR lpszPath, int drive)
Definition: path.c:329
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 GLint GLint j
Definition: glfuncs.h:250
#define sprintf(buf, format,...)
Definition: sprintf.c:55

Referenced by START_TEST().

◆ test_PathCanonicalizeA()

static void test_PathCanonicalizeA ( void  )
static

Definition at line 942 of file path.c.

943{
944 char dest[LONG_LEN + MAX_PATH];
945 char too_long[LONG_LEN];
946 BOOL res;
947
948 /* try a NULL source */
949 lstrcpyA(dest, "test");
950 SetLastError(0xdeadbeef);
952 ok(!res, "Expected failure\n");
954 "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
955 ok(dest[0] == 0 || !lstrcmpA(dest, "test"),
956 "Expected either an empty string (Vista) or test, got %s\n", dest);
957
958 /* try an empty source */
959 lstrcpyA(dest, "test");
960 SetLastError(0xdeadbeef);
962 ok(res, "Expected success\n");
963 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
964 ok(!lstrcmpA(dest, "\\") ||
965 broken(!lstrcmpA(dest, "test")), /* Win95 and some W2K */
966 "Expected \\, got %s\n", dest);
967
968 /* try a NULL dest */
969 SetLastError(0xdeadbeef);
970 res = PathCanonicalizeA(NULL, "C:\\");
971 ok(!res, "Expected failure\n");
973 "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
974
975 /* try empty dest */
976 dest[0] = '\0';
977 SetLastError(0xdeadbeef);
978 res = PathCanonicalizeA(dest, "C:\\");
979 ok(res, "Expected success\n");
980 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
981 ok(!lstrcmpA(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
982
983 /* try non-empty dest */
984 lstrcpyA(dest, "test");
985 SetLastError(0xdeadbeef);
986 res = PathCanonicalizeA(dest, "C:\\");
987 ok(res, "Expected success\n");
988 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
989 ok(!lstrcmpA(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
990
991 /* try a space for source */
992 lstrcpyA(dest, "test");
993 SetLastError(0xdeadbeef);
994 res = PathCanonicalizeA(dest, " ");
995 ok(res, "Expected success\n");
996 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
997 ok(!lstrcmpA(dest, " "), "Expected ' ', got %s\n", dest);
998
999 /* try a relative path */
1000 lstrcpyA(dest, "test");
1001 SetLastError(0xdeadbeef);
1002 res = PathCanonicalizeA(dest, "one\\two");
1003 ok(res, "Expected success\n");
1004 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1005 ok(!lstrcmpA(dest, "one\\two"), "Expected one\\two, got %s\n", dest);
1006
1007 /* try current dir and previous dir */
1008 lstrcpyA(dest, "test");
1009 SetLastError(0xdeadbeef);
1010 res = PathCanonicalizeA(dest, "C:\\one\\.\\..\\two\\three\\..");
1011 ok(res, "Expected success\n");
1012 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1013 ok(!lstrcmpA(dest, "C:\\two"), "Expected C:\\two, got %s\n", dest);
1014
1015 /* try simple forward slashes */
1016 lstrcpyA(dest, "test");
1017 SetLastError(0xdeadbeef);
1018 res = PathCanonicalizeA(dest, "C:\\one/two/three\\four/five\\six");
1019 ok(res, "Expected success\n");
1020 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1021 ok(!lstrcmpA(dest, "C:\\one/two/three\\four/five\\six"),
1022 "Expected C:\\one/two/three\\four/five\\six, got %s\n", dest);
1023
1024 /* try simple forward slashes with same dir */
1025 lstrcpyA(dest, "test");
1026 SetLastError(0xdeadbeef);
1027 res = PathCanonicalizeA(dest, "C:\\one/.\\two");
1028 ok(res, "Expected success\n");
1029 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1030 ok(!lstrcmpA(dest, "C:\\one/.\\two"), "Expected C:\\one/.\\two, got %s\n", dest);
1031
1032 /* try simple forward slashes with change dir */
1033 lstrcpyA(dest, "test");
1034 SetLastError(0xdeadbeef);
1035 res = PathCanonicalizeA(dest, "C:\\one/.\\two\\..");
1036 ok(res, "Expected success\n");
1037 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1038 ok(!lstrcmpA(dest, "C:\\one/.") ||
1039 !lstrcmpA(dest, "C:\\one/"), /* Vista */
1040 "Expected \"C:\\one/.\" or \"C:\\one/\", got \"%s\"\n", dest);
1041
1042 /* try forward slashes with change dirs
1043 * NOTE: if there is a forward slash in between two backslashes,
1044 * everything in between the two backslashes is considered on dir
1045 */
1046 lstrcpyA(dest, "test");
1047 SetLastError(0xdeadbeef);
1048 res = PathCanonicalizeA(dest, "C:\\one/.\\..\\two/three\\..\\four/.five");
1049 ok(res, "Expected success\n");
1050 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1051 ok(!lstrcmpA(dest, "C:\\four/.five"), "Expected C:\\four/.five, got %s\n", dest);
1052
1053 /* try src is too long */
1054 memset(too_long, 'a', LONG_LEN);
1055 too_long[LONG_LEN - 1] = '\0';
1056 lstrcpyA(dest, "test");
1057 SetLastError(0xdeadbeef);
1058 res = PathCanonicalizeA(dest, too_long);
1059 ok(!res ||
1060 broken(res), /* Win95, some W2K and XP-SP1 */
1061 "Expected failure\n");
1062 todo_wine
1063 {
1064 ok(GetLastError() == 0xdeadbeef || GetLastError() == ERROR_FILENAME_EXCED_RANGE /* Vista */,
1065 "Expected 0xdeadbeef or ERROR_FILENAME_EXCED_RANGE, got %d\n", GetLastError());
1066 }
1067 ok(lstrlenA(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlenA(too_long));
1068}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
BOOL WINAPI PathCanonicalizeA(LPSTR lpszBuf, LPCSTR lpszPath)
Definition: path.c:2412
static char * dest
Definition: rtl.c:135
#define ERROR_FILENAME_EXCED_RANGE
Definition: winerror.h:263

Referenced by START_TEST().

◆ test_PathCombineA()

static void test_PathCombineA ( void  )
static

Definition at line 558 of file path.c.

559{
560 LPSTR str;
561 char dest[MAX_PATH];
562 char too_long[LONG_LEN];
563 char one[HALF_LEN], two[HALF_LEN];
564
565 /* try NULL dest */
566 SetLastError(0xdeadbeef);
567 str = PathCombineA(NULL, "C:\\", "one\\two\\three");
568 ok(str == NULL, "Expected NULL, got %p\n", str);
569 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
570
571 /* try NULL dest and NULL directory */
572 SetLastError(0xdeadbeef);
573 str = PathCombineA(NULL, NULL, "one\\two\\three");
574 ok(str == NULL, "Expected NULL, got %p\n", str);
575 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
576
577 /* try all NULL*/
578 SetLastError(0xdeadbeef);
580 ok(str == NULL, "Expected NULL, got %p\n", str);
581 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
582
583 /* try NULL file part */
584 SetLastError(0xdeadbeef);
585 lstrcpyA(dest, "control");
586 str = PathCombineA(dest, "C:\\", NULL);
587 ok(str == dest, "Expected str == dest, got %p\n", str);
588 ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
589 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
590
591 /* try empty file part */
592 SetLastError(0xdeadbeef);
593 lstrcpyA(dest, "control");
594 str = PathCombineA(dest, "C:\\", "");
595 ok(str == dest, "Expected str == dest, got %p\n", str);
596 ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
597 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
598
599 /* try empty directory and file part */
600 SetLastError(0xdeadbeef);
601 lstrcpyA(dest, "control");
602 str = PathCombineA(dest, "", "");
603 ok(str == dest, "Expected str == dest, got %p\n", str);
604 ok(!lstrcmpA(str, "\\") ||
605 broken(!lstrcmpA(str, "control")), /* Win95 and some W2K */
606 "Expected \\, got %s\n", str);
607 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
608
609 /* try NULL directory */
610 SetLastError(0xdeadbeef);
611 lstrcpyA(dest, "control");
612 str = PathCombineA(dest, NULL, "one\\two\\three");
613 ok(str == dest, "Expected str == dest, got %p\n", str);
614 ok(!lstrcmpA(str, "one\\two\\three"), "Expected one\\two\\three, got %s\n", str);
615 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
616
617 /* try NULL directory and empty file part */
618 SetLastError(0xdeadbeef);
619 lstrcpyA(dest, "control");
620 str = PathCombineA(dest, NULL, "");
621 ok(str == dest, "Expected str == dest, got %p\n", str);
622 ok(!lstrcmpA(str, "\\") ||
623 broken(!lstrcmpA(str, "one\\two\\three")), /* Win95 and some W2K */
624 "Expected \\, got %s\n", str);
625 ok(GetLastError() == 0xdeadbeef ||
627 "Expected 0xdeadbeef, got %d\n", GetLastError());
628
629 /* try NULL directory and file part */
630 SetLastError(0xdeadbeef);
631 lstrcpyA(dest, "control");
633 ok(str == NULL ||
634 broken(str != NULL), /* Win95 and some W2K */
635 "Expected str == NULL, got %p\n", str);
636 ok(!dest[0] || broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
637 "Expected 0 length, got %i\n", lstrlenA(dest));
638 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
639
640 /* try directory without backslash */
641 SetLastError(0xdeadbeef);
642 lstrcpyA(dest, "control");
643 str = PathCombineA(dest, "C:", "one\\two\\three");
644 ok(str == dest, "Expected str == dest, got %p\n", str);
645 ok(!lstrcmpA(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
646 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
647
648 /* try directory with backslash */
649 SetLastError(0xdeadbeef);
650 lstrcpyA(dest, "control");
651 str = PathCombineA(dest, "C:\\", "one\\two\\three");
652 ok(str == dest, "Expected str == dest, got %p\n", str);
653 ok(!lstrcmpA(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
654 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
655
656 /* try directory with backslash and file with prepended backslash */
657 SetLastError(0xdeadbeef);
658 lstrcpyA(dest, "control");
659 str = PathCombineA(dest, "C:\\", "\\one\\two\\three");
660 ok(str == dest, "Expected str == dest, got %p\n", str);
661 ok(!lstrcmpA(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
662 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
663
664 /* try previous test, with backslash appended as well */
665 SetLastError(0xdeadbeef);
666 lstrcpyA(dest, "control");
667 str = PathCombineA(dest, "C:\\", "\\one\\two\\three\\");
668 ok(str == dest, "Expected str == dest, got %p\n", str);
669 ok(!lstrcmpA(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
670 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
671
672 /* try a relative directory */
673 SetLastError(0xdeadbeef);
674 lstrcpyA(dest, "control");
675 str = PathCombineA(dest, "relative\\dir", "\\one\\two\\three\\");
676 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
677 /* Vista fails which probably makes sense as PathCombineA expects an absolute dir */
678 if (str)
679 {
680 ok(str == dest, "Expected str == dest, got %p\n", str);
681 ok(!lstrcmpA(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str);
682 }
683
684 /* try forward slashes */
685 SetLastError(0xdeadbeef);
686 lstrcpyA(dest, "control");
687 str = PathCombineA(dest, "C:\\", "one/two/three\\");
688 ok(str == dest, "Expected str == dest, got %p\n", str);
689 ok(!lstrcmpA(str, "C:\\one/two/three\\"), "Expected one/two/three\\, got %s\n", str);
690 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
691
692 /* try a really weird directory */
693 SetLastError(0xdeadbeef);
694 lstrcpyA(dest, "control");
695 str = PathCombineA(dest, "C:\\/\\/", "\\one\\two\\three\\");
696 ok(str == dest, "Expected str == dest, got %p\n", str);
697 ok(!lstrcmpA(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
698 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
699
700 /* try periods */
701 SetLastError(0xdeadbeef);
702 lstrcpyA(dest, "control");
703 str = PathCombineA(dest, "C:\\", "one\\..\\two\\.\\three");
704 ok(str == dest, "Expected str == dest, got %p\n", str);
705 ok(!lstrcmpA(str, "C:\\two\\three"), "Expected C:\\two\\three, got %s\n", str);
706 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
707
708 /* try .. as file */
709 /* try forward slashes */
710 SetLastError(0xdeadbeef);
711 lstrcpyA(dest, "control");
712 str = PathCombineA(dest, "C:\\", "..");
713 ok(str == dest, "Expected str == dest, got %p\n", str);
714 ok(!lstrcmpA(str, "C:\\"), "Expected C:\\, got %s\n", str);
715 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
716
717 memset(too_long, 'a', LONG_LEN);
718 too_long[LONG_LEN - 1] = '\0';
719
720 /* try a file longer than MAX_PATH */
721 SetLastError(0xdeadbeef);
722 lstrcpyA(dest, "control");
723 str = PathCombineA(dest, "C:\\", too_long);
724 ok(str == NULL, "Expected str == NULL, got %p\n", str);
725 ok(!dest[0] || broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
726 "Expected 0 length, got %i\n", lstrlenA(dest));
727 todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
728
729 /* try a directory longer than MAX_PATH */
730 SetLastError(0xdeadbeef);
731 lstrcpyA(dest, "control");
732 str = PathCombineA(dest, too_long, "one\\two\\three");
733 ok(str == NULL, "Expected str == NULL, got %p\n", str);
734 ok(!dest[0] || broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
735 "Expected 0 length, got %i\n", lstrlenA(dest));
736 todo_wine ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
737
738 memset(one, 'b', HALF_LEN);
739 memset(two, 'c', HALF_LEN);
740 one[HALF_LEN - 1] = '\0';
741 two[HALF_LEN - 1] = '\0';
742
743 /* destination string is longer than MAX_PATH, but not the constituent parts */
744 SetLastError(0xdeadbeef);
745 lstrcpyA(dest, "control");
747 ok(str == NULL, "Expected str == NULL, got %p\n", str);
748 ok(!dest[0] || broken(!lstrcmpA(dest, "control")), /* Win95 and some W2K */
749 "Expected 0 length, got %i\n", lstrlenA(dest));
750 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
751}
LPSTR WINAPI PathCombineA(LPSTR lpszDest, LPCSTR lpszDir, LPCSTR lpszFile)
Definition: path.c:159
static double two
Definition: jn_yn.c:52
int one
Definition: sehframes.cpp:28

Referenced by START_TEST().

◆ test_PathCombineW()

static void test_PathCombineW ( void  )
static

Definition at line 503 of file path.c.

504{
505 LPWSTR wszString, wszString2;
506 WCHAR wbuf[MAX_PATH+1], wstr1[MAX_PATH] = {'C',':','\\',0}, wstr2[MAX_PATH];
507 static const WCHAR expout[] = {'C',':','\\','A','A',0};
508 int i;
509
510 if (!pPathCombineW)
511 {
512 win_skip("PathCombineW isn't available\n");
513 return;
514 }
515
516 wszString2 = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
517
518 /* NULL test */
519 wszString = pPathCombineW(NULL, NULL, NULL);
520 ok (wszString == NULL, "Expected a NULL return\n");
521
522 /* Some NULL */
523 wszString2[0] = 'a';
524 wszString = pPathCombineW(wszString2, NULL, NULL);
525 ok (wszString == NULL ||
526 broken(wszString[0] == 'a'), /* Win95 and some W2K */
527 "Expected a NULL return\n");
528 ok (wszString2[0] == 0 ||
529 broken(wszString2[0] == 'a'), /* Win95 and some W2K */
530 "Destination string not empty\n");
531
532 HeapFree(GetProcessHeap(), 0, wszString2);
533
534 /* overflow test */
535 wstr2[0] = wstr2[1] = wstr2[2] = 'A';
536 for (i=3; i<MAX_PATH/2; i++)
537 wstr1[i] = wstr2[i] = 'A';
538 wstr1[(MAX_PATH/2) - 1] = wstr2[MAX_PATH/2] = 0;
539 memset(wbuf, 0xbf, sizeof(wbuf));
540
541 wszString = pPathCombineW(wbuf, wstr1, wstr2);
542 ok(wszString == NULL, "Expected a NULL return\n");
543 ok(wbuf[0] == 0 ||
544 broken(wbuf[0] == 0xbfbf), /* Win95 and some W2K */
545 "Buffer contains data\n");
546
547 /* PathCombineW can be used in place */
548 wstr1[3] = 0;
549 wstr2[2] = 0;
550 ok(PathCombineW(wstr1, wstr1, wstr2) == wstr1, "Expected a wstr1 return\n");
551 ok(StrCmpW(wstr1, expout) == 0, "Unexpected PathCombine output\n");
552}
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
Definition: path.c:194
int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:434
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
Definition: glfuncs.h:248
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by START_TEST().

◆ test_PathCommonPrefixA()

static void test_PathCommonPrefixA ( void  )
static

Definition at line 1192 of file path.c.

1193{
1194 char path1[MAX_PATH], path2[MAX_PATH];
1195 char out[MAX_PATH];
1196 int count;
1197
1198 /* test NULL path1 */
1199 SetLastError(0xdeadbeef);
1200 lstrcpyA(path2, "C:\\");
1201 lstrcpyA(out, "aaa");
1203 ok(count == 0, "Expected 0, got %i\n", count);
1204 todo_wine
1205 {
1206 ok(!lstrcmpA(out, "aaa"), "Expected aaa, got %s\n", out);
1207 }
1208 ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
1209 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1210
1211 /* test NULL path2 */
1212 SetLastError(0xdeadbeef);
1213 lstrcpyA(path1, "C:\\");
1214 lstrcpyA(out, "aaa");
1216 ok(count == 0, "Expected 0, got %i\n", count);
1217 todo_wine
1218 {
1219 ok(!lstrcmpA(out, "aaa"), "Expected aaa, got %s\n", out);
1220 }
1221 ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
1222 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1223
1224 /* test empty path1 */
1225 SetLastError(0xdeadbeef);
1226 path1[0] = '\0';
1227 lstrcpyA(path2, "C:\\");
1228 lstrcpyA(out, "aaa");
1230 ok(count == 0, "Expected 0, got %i\n", count);
1231 ok(!out[0], "Expected 0 length out, got %i\n", lstrlenA(out));
1232 ok(!path1[0], "Expected 0 length path1, got %i\n", lstrlenA(path1));
1233 ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
1234 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1235
1236 /* test empty path1 */
1237 SetLastError(0xdeadbeef);
1238 path2[0] = '\0';
1239 lstrcpyA(path1, "C:\\");
1240 lstrcpyA(out, "aaa");
1242 ok(count == 0, "Expected 0, got %i\n", count);
1243 ok(!out[0], "Expected 0 length out, got %i\n", lstrlenA(out));
1244 ok(!path2[0], "Expected 0 length path2, got %i\n", lstrlenA(path2));
1245 ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
1246 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1247
1248 /* paths are legit, out is NULL */
1249 SetLastError(0xdeadbeef);
1250 lstrcpyA(path1, "C:\\");
1251 lstrcpyA(path2, "C:\\");
1253 ok(count == 3, "Expected 3, got %i\n", count);
1254 ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
1255 ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
1256 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1257
1258 /* all parameters legit */
1259 SetLastError(0xdeadbeef);
1260 lstrcpyA(path1, "C:\\");
1261 lstrcpyA(path2, "C:\\");
1262 lstrcpyA(out, "aaa");
1264 ok(count == 3, "Expected 3, got %i\n", count);
1265 ok(!lstrcmpA(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
1266 ok(!lstrcmpA(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
1267 ok(!lstrcmpA(out, "C:\\"), "Expected C:\\, got %s\n", out);
1268 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1269
1270 /* path1 and path2 not the same, but common prefix */
1271 SetLastError(0xdeadbeef);
1272 lstrcpyA(path1, "C:\\one\\two");
1273 lstrcpyA(path2, "C:\\one\\three");
1274 lstrcpyA(out, "aaa");
1276 ok(count == 6, "Expected 6, got %i\n", count);
1277 ok(!lstrcmpA(path1, "C:\\one\\two"), "Expected C:\\one\\two, got %s\n", path1);
1278 ok(!lstrcmpA(path2, "C:\\one\\three"), "Expected C:\\one\\three, got %s\n", path2);
1279 ok(!lstrcmpA(out, "C:\\one"), "Expected C:\\one, got %s\n", out);
1280 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1281
1282 /* try . prefix */
1283 SetLastError(0xdeadbeef);
1284 lstrcpyA(path1, "one\\.two");
1285 lstrcpyA(path2, "one\\.three");
1286 lstrcpyA(out, "aaa");
1288 ok(count == 3, "Expected 3, got %i\n", count);
1289 ok(!lstrcmpA(path1, "one\\.two"), "Expected one\\.two, got %s\n", path1);
1290 ok(!lstrcmpA(path2, "one\\.three"), "Expected one\\.three, got %s\n", path2);
1291 ok(!lstrcmpA(out, "one"), "Expected one, got %s\n", out);
1292 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1293
1294 /* try .. prefix */
1295 SetLastError(0xdeadbeef);
1296 lstrcpyA(path1, "one\\..two");
1297 lstrcpyA(path2, "one\\..three");
1298 lstrcpyA(out, "aaa");
1300 ok(count == 3, "Expected 3, got %i\n", count);
1301 ok(!lstrcmpA(path1, "one\\..two"), "Expected one\\..two, got %s\n", path1);
1302 ok(!lstrcmpA(path2, "one\\..three"), "Expected one\\..three, got %s\n", path2);
1303 ok(!lstrcmpA(out, "one"), "Expected one, got %s\n", out);
1304 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1305
1306 /* try ... prefix */
1307 SetLastError(0xdeadbeef);
1308 lstrcpyA(path1, "one\\...two");
1309 lstrcpyA(path2, "one\\...three");
1310 lstrcpyA(out, "aaa");
1312 ok(count == 3, "Expected 3, got %i\n", count);
1313 ok(!lstrcmpA(path1, "one\\...two"), "Expected one\\...two, got %s\n", path1);
1314 ok(!lstrcmpA(path2, "one\\...three"), "Expected one\\...three, got %s\n", path2);
1315 ok(!lstrcmpA(out, "one"), "Expected one, got %s\n", out);
1316 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1317
1318 /* try .\ prefix */
1319 SetLastError(0xdeadbeef);
1320 lstrcpyA(path1, "one\\.\\two");
1321 lstrcpyA(path2, "one\\.\\three");
1322 lstrcpyA(out, "aaa");
1324 ok(count == 5, "Expected 5, got %i\n", count);
1325 ok(!lstrcmpA(path1, "one\\.\\two"), "Expected one\\.\\two, got %s\n", path1);
1326 ok(!lstrcmpA(path2, "one\\.\\three"), "Expected one\\.\\three, got %s\n", path2);
1327 ok(!lstrcmpA(out, "one\\."), "Expected one\\., got %s\n", out);
1328 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1329
1330 /* try ..\ prefix */
1331 SetLastError(0xdeadbeef);
1332 lstrcpyA(path1, "one\\..\\two");
1333 lstrcpyA(path2, "one\\..\\three");
1334 lstrcpyA(out, "aaa");
1336 ok(count == 6, "Expected 6, got %i\n", count);
1337 ok(!lstrcmpA(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
1338 ok(!lstrcmpA(path2, "one\\..\\three"), "Expected one\\..\\three, got %s\n", path2);
1339 ok(!lstrcmpA(out, "one\\.."), "Expected one\\.., got %s\n", out);
1340 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1341
1342 /* try ...\\ prefix */
1343 SetLastError(0xdeadbeef);
1344 lstrcpyA(path1, "one\\...\\two");
1345 lstrcpyA(path2, "one\\...\\three");
1346 lstrcpyA(out, "aaa");
1348 ok(count == 7, "Expected 7, got %i\n", count);
1349 ok(!lstrcmpA(path1, "one\\...\\two"), "Expected one\\...\\two, got %s\n", path1);
1350 ok(!lstrcmpA(path2, "one\\...\\three"), "Expected one\\...\\three, got %s\n", path2);
1351 ok(!lstrcmpA(out, "one\\..."), "Expected one\\..., got %s\n", out);
1352 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1353
1354 /* try prefix that is not an msdn labeled prefix type */
1355 SetLastError(0xdeadbeef);
1356 lstrcpyA(path1, "same");
1357 lstrcpyA(path2, "same");
1358 lstrcpyA(out, "aaa");
1360 ok(count == 4, "Expected 4, got %i\n", count);
1361 ok(!lstrcmpA(path1, "same"), "Expected same, got %s\n", path1);
1362 ok(!lstrcmpA(path2, "same"), "Expected same, got %s\n", path2);
1363 ok(!lstrcmpA(out, "same"), "Expected same, got %s\n", out);
1364 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1365
1366 /* try . after directory */
1367 SetLastError(0xdeadbeef);
1368 lstrcpyA(path1, "one\\mid.\\two");
1369 lstrcpyA(path2, "one\\mid.\\three");
1370 lstrcpyA(out, "aaa");
1372 ok(count == 8, "Expected 8, got %i\n", count);
1373 ok(!lstrcmpA(path1, "one\\mid.\\two"), "Expected one\\mid.\\two, got %s\n", path1);
1374 ok(!lstrcmpA(path2, "one\\mid.\\three"), "Expected one\\mid.\\three, got %s\n", path2);
1375 ok(!lstrcmpA(out, "one\\mid."), "Expected one\\mid., got %s\n", out);
1376 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1377
1378 /* try . in the middle of a directory */
1379 SetLastError(0xdeadbeef);
1380 lstrcpyA(path1, "one\\mid.end\\two");
1381 lstrcpyA(path2, "one\\mid.end\\three");
1382 lstrcpyA(out, "aaa");
1384 ok(count == 11, "Expected 11, got %i\n", count);
1385 ok(!lstrcmpA(path1, "one\\mid.end\\two"), "Expected one\\mid.end\\two, got %s\n", path1);
1386 ok(!lstrcmpA(path2, "one\\mid.end\\three"), "Expected one\\mid.end\\three, got %s\n", path2);
1387 ok(!lstrcmpA(out, "one\\mid.end"), "Expected one\\mid.end, got %s\n", out);
1388 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1389
1390 /* try comparing a .. with the expanded path */
1391 SetLastError(0xdeadbeef);
1392 lstrcpyA(path1, "one\\..\\two");
1393 lstrcpyA(path2, "two");
1394 lstrcpyA(out, "aaa");
1396 ok(count == 0, "Expected 0, got %i\n", count);
1397 ok(!lstrcmpA(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
1398 ok(!lstrcmpA(path2, "two"), "Expected two, got %s\n", path2);
1399 ok(!out[0], "Expected 0 length out, got %i\n", lstrlenA(out));
1400 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1401}
int WINAPI PathCommonPrefixA(LPCSTR lpszFile1, LPCSTR lpszFile2, LPSTR achPath)
Definition: path.c:2750
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const WCHAR path1[]
Definition: path.c:28
static const WCHAR path2[]
Definition: path.c:29
static FILE * out
Definition: regtests2xml.c:44

Referenced by START_TEST().

◆ test_PathCreateFromUrl()

static void test_PathCreateFromUrl ( void  )
static

Definition at line 266 of file path.c.

267{
268 size_t i;
269 char ret_path[INTERNET_MAX_URL_LENGTH];
270 DWORD len, len2, ret;
272 WCHAR *pathW, *urlW;
273
274 if (!pPathCreateFromUrlA) {
275 win_skip("PathCreateFromUrlA not found\n");
276 return;
277 }
278
279 /* Won't say how much is needed without a buffer */
280 len = 0xdeca;
281 ret = pPathCreateFromUrlA("file://foo", NULL, &len, 0);
282 ok(ret == E_INVALIDARG, "got 0x%08x expected E_INVALIDARG\n", ret);
283 ok(len == 0xdeca, "got %x expected 0xdeca\n", len);
284
285 /* Test the decoding itself */
286 for (i = 0; i < ARRAY_SIZE(TEST_PATHFROMURL); i++) {
288 ret = pPathCreateFromUrlA(TEST_PATHFROMURL[i].url, ret_path, &len, 0);
290 ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url %s\n", ret, TEST_PATHFROMURL[i].url);
292 if(!(TEST_PATHFROMURL[i].todo & 0x2)) {
293 ok(!lstrcmpiA(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
294 ok(len == strlen(ret_path), "ret len %d from url %s\n", len, TEST_PATHFROMURL[i].url);
295 } else todo_wine
296 /* Wrong string, don't bother checking the length */
297 ok(!lstrcmpiA(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
298 }
299
300 if (pPathCreateFromUrlW) {
304 ret = pPathCreateFromUrlW(urlW, ret_pathW, &len, 0);
305 WideCharToMultiByte(CP_ACP, 0, ret_pathW, -1, ret_path, sizeof(ret_path),NULL,NULL);
307 ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url L\"%s\"\n", ret, TEST_PATHFROMURL[i].url);
309 if(!(TEST_PATHFROMURL[i].todo & 0x2)) {
310 ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url L\"%s\"\n",
312 ok(len == lstrlenW(ret_pathW), "ret len %d from url L\"%s\"\n", len, TEST_PATHFROMURL[i].url);
313 } else todo_wine
314 /* Wrong string, don't bother checking the length */
315 ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url L\"%s\"\n",
317 }
318
319 if (SUCCEEDED(ret))
320 {
321 /* Check what happens if the buffer is too small */
322 len2 = 2;
323 ret = pPathCreateFromUrlW(urlW, ret_pathW, &len2, 0);
324 ok(ret == E_POINTER, "ret %08x, expected E_POINTER from url %s\n", ret, TEST_PATHFROMURL[i].url);
326 ok(len2 == len + 1, "got len = %d expected %d from url %s\n", len2, len + 1, TEST_PATHFROMURL[i].url);
327 }
328
329 FreeWideString(urlW);
330 FreeWideString(pathW);
331 }
332 }
333
334 if (pPathCreateFromUrlAlloc)
335 {
336 static const WCHAR fileW[] = {'f','i','l','e',':','/','/','f','o','o',0};
337 static const WCHAR fooW[] = {'\\','\\','f','o','o',0};
338
339 pathW = NULL;
340 ret = pPathCreateFromUrlAlloc(fileW, &pathW, 0);
341 ok(ret == S_OK, "got 0x%08x expected S_OK\n", ret);
342 ok(lstrcmpiW(pathW, fooW) == 0, "got %s expected %s\n", wine_dbgstr_w(pathW), wine_dbgstr_w(fooW));
343 HeapFree(GetProcessHeap(), 0, pathW);
344 }
345}
#define ARRAY_SIZE(a)
Definition: main.h:24
#define E_INVALIDARG
Definition: ddrawi.h:101
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrlenW
Definition: compat.h:750
static const WCHAR fileW[]
Definition: url.c:111
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define wine_dbgstr_w
Definition: kernel32.h:34
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static const WCHAR fooW[]
Definition: locale.c:44
#define todo_wine_if(is_todo)
Definition: custom.c:76
static const struct @1678 TEST_PATHFROMURL[]
DWORD todo
Definition: path.c:47
static LPWSTR GetWideString(const char *src)
Definition: path.c:186
static void FreeWideString(LPWSTR wszString)
Definition: path.c:200
const char * url
Definition: path.c:45
#define E_POINTER
Definition: winerror.h:2365

Referenced by START_TEST().

◆ test_PathFindExtensionA()

static void test_PathFindExtensionA ( void  )
static

Definition at line 1070 of file path.c.

1071{
1072 LPSTR ext;
1073 char path[MAX_PATH];
1074 char too_long[LONG_LEN];
1075
1076 /* try a NULL path */
1077 SetLastError(0xdeadbeef);
1079 ok(ext == NULL, "Expected NULL, got %p\n", ext);
1080 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1081
1082 /* try an empty path */
1083 path[0] = '\0';
1084 SetLastError(0xdeadbeef);
1086 ok(ext == path, "Expected ext == path, got %p\n", ext);
1087 ok(!ext[0], "Expected length 0, got %i\n", lstrlenA(ext));
1088 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1089
1090 /* try a path without an extension */
1091 lstrcpyA(path, "file");
1092 SetLastError(0xdeadbeef);
1094 ok(ext == path + lstrlenA(path), "Expected ext == path, got %p\n", ext);
1095 ok(!ext[0], "Expected length 0, got %i\n", lstrlenA(ext));
1096 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1097
1098 /* try a path with an extension */
1099 lstrcpyA(path, "file.txt");
1100 SetLastError(0xdeadbeef);
1102 ok(ext == path + lstrlenA("file"),
1103 "Expected ext == path + lstrlenA(\"file\"), got %p\n", ext);
1104 ok(!lstrcmpA(ext, ".txt"), "Expected .txt, got %s\n", ext);
1105 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1106
1107 /* try a path with two extensions */
1108 lstrcpyA(path, "file.txt.doc");
1109 SetLastError(0xdeadbeef);
1111 ok(ext == path + lstrlenA("file.txt"),
1112 "Expected ext == path + lstrlenA(\"file.txt\"), got %p\n", ext);
1113 ok(!lstrcmpA(ext, ".doc"), "Expected .txt, got %s\n", ext);
1114 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1115
1116 /* try a path longer than MAX_PATH without an extension*/
1117 memset(too_long, 'a', LONG_LEN);
1118 too_long[LONG_LEN - 1] = '\0';
1119 SetLastError(0xdeadbeef);
1120 ext = PathFindExtensionA(too_long);
1121 ok(ext == too_long + LONG_LEN - 1, "Expected ext == too_long + LONG_LEN - 1, got %p\n", ext);
1122 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1123
1124 /* try a path longer than MAX_PATH with an extension*/
1125 memset(too_long, 'a', LONG_LEN);
1126 too_long[LONG_LEN - 1] = '\0';
1127 lstrcpyA(too_long + 300, ".abcde");
1128 too_long[lstrlenA(too_long)] = 'a';
1129 SetLastError(0xdeadbeef);
1130 ext = PathFindExtensionA(too_long);
1131 ok(ext == too_long + 300, "Expected ext == too_long + 300, got %p\n", ext);
1132 ok(lstrlenA(ext) == LONG_LEN - 301, "Expected LONG_LEN - 301, got %i\n", lstrlenA(ext));
1133 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
1134}
static const WCHAR *const ext[]
Definition: module.c:53
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
Definition: path.c:422

Referenced by START_TEST().

◆ test_PathGetDriveNumber()

static void test_PathGetDriveNumber ( void  )
static

Definition at line 1426 of file path.c.

1427{
1428 static const CHAR test1A[] = "a:\\test.file";
1429 static const CHAR test2A[] = "file:////b:\\test.file";
1430 static const CHAR test3A[] = "file:///c:\\test.file";
1431 static const CHAR test4A[] = "file:\\\\c:\\test.file";
1432 static const CHAR test5A[] = "\\\\?\\C:\\dir\\file.txt";
1433 static const WCHAR test1W[] =
1434 {'a',':','\\',0};
1435 static const WCHAR test5W[] =
1436 {'\\','\\','?','\\','C',':','\\','d','i','r','\\','f','i','l','e',0};
1437 int ret;
1438
1439 SetLastError(0xdeadbeef);
1441 ok(ret == -1, "got %d\n", ret);
1442 ok(GetLastError() == 0xdeadbeef, "got %d\n", GetLastError());
1443
1444 ret = PathGetDriveNumberA(test1A);
1445 ok(ret == 0, "got %d\n", ret);
1446 ret = PathGetDriveNumberW(test1W);
1447 ok(ret == 0, "got %d\n", ret);
1448 ret = PathGetDriveNumberA(test2A);
1449 ok(ret == -1, "got %d\n", ret);
1450 ret = PathGetDriveNumberA(test3A);
1451 ok(ret == -1, "got %d\n", ret);
1452 ret = PathGetDriveNumberA(test4A);
1453 ok(ret == -1, "got %d\n", ret);
1454
1455 ret = PathGetDriveNumberA(test5A);
1456 ok(ret == -1, "got %d\n", ret);
1457 ret = PathGetDriveNumberW(test5W);
1458 ok(ret == 2 || broken(ret == -1) /* winxp */, "got = %d\n", ret);
1459}
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553
int WINAPI PathGetDriveNumberA(LPCSTR lpszPath)
Definition: path.c:538
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ test_PathIsRelativeA()

static void test_PathIsRelativeA ( void  )
static

Definition at line 1619 of file path.c.

1620{
1621 BOOL ret;
1622 int i, num;
1623
1624 if (!pPathIsRelativeA) {
1625 win_skip("PathIsRelativeA not available\n");
1626 return;
1627 }
1628
1630 for (i = 0; i < num; i++) {
1631 ret = pPathIsRelativeA(test_path_is_relative[i].path);
1633 "PathIsRelativeA(\"%s\") expects %d, got %d.\n",
1635 }
1636}
GLuint GLuint num
Definition: glext.h:9618
#define expect(expected, got)
Definition: path.c:34
static const struct @1681 test_path_is_relative[]

Referenced by START_TEST().

◆ test_PathIsRelativeW()

static void test_PathIsRelativeW ( void  )
static

Definition at line 1638 of file path.c.

1639{
1640 BOOL ret;
1641 int i, num;
1642 LPWSTR path;
1643
1644 if (!pPathIsRelativeW) {
1645 win_skip("PathIsRelativeW not available\n");
1646 return;
1647 }
1648
1650 for (i = 0; i < num; i++) {
1652
1653 ret = pPathIsRelativeW(path);
1655 "PathIsRelativeW(\"%s\") expects %d, got %d.\n",
1657
1659 }
1660}

Referenced by START_TEST().

◆ test_PathIsUrl()

static void test_PathIsUrl ( void  )
static

Definition at line 348 of file path.c.

349{
350 size_t i;
351 BOOL ret;
352
353 for (i = 0; i < ARRAY_SIZE(TEST_PATH_IS_URL); i++) {
356 "returned %d from path %s, expected %d\n", ret, TEST_PATH_IS_URL[i].path,
358 }
359}
BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
Definition: url.c:2412
static struct @1679 TEST_PATH_IS_URL[]

Referenced by START_TEST().

◆ test_PathIsValidCharA()

static void test_PathIsValidCharA ( void  )
static

Definition at line 397 of file path.c.

398{
399 BOOL ret;
400 unsigned int c;
401
402 /* For whatever reason, PathIsValidCharA and PathAppendA share the same
403 * ordinal number in some native versions. Check this to prevent a crash.
404 */
405 if (!pPathIsValidCharA || pPathIsValidCharA == (void*)pPathAppendA)
406 {
407 win_skip("PathIsValidCharA isn't available\n");
408 return;
409 }
410
411 for (c = 0; c < 0x7f; c++)
412 {
413 ret = pPathIsValidCharA( c, ~0U );
414 ok ( ret || !SHELL_charclass[c], "PathIsValidCharA failed: 0x%02x got 0x%08x\n", c, ret );
415 }
416
417 for (c = 0x7f; c <= 0xff; c++)
418 {
419 ret = pPathIsValidCharA( c, ~0U );
420 ok ( ret, "PathIsValidCharA failed: 0x%02x got 0x%08x\n", c, ret );
421 }
422}
#define U(x)
Definition: wordpad.c:45
static const DWORD SHELL_charclass[]
Definition: path.c:4330
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80

Referenced by START_TEST().

◆ test_PathIsValidCharW()

static void test_PathIsValidCharW ( void  )
static

Definition at line 424 of file path.c.

425{
426 BOOL ret;
427 unsigned int c;
428
429 if (!pPathIsValidCharW)
430 {
431 win_skip("PathIsValidCharW isn't available\n");
432 return;
433 }
434
435 for (c = 0; c < 0x7f; c++)
436 {
437 ret = pPathIsValidCharW( c, ~0U );
438 ok ( ret || !SHELL_charclass[c], "PathIsValidCharW failed: 0x%02x got 0x%08x\n", c, ret );
439 }
440
441 for (c = 0x007f; c <= 0xffff; c++)
442 {
443 ret = pPathIsValidCharW( c, ~0U );
444 ok ( ret, "PathIsValidCharW failed: 0x%02x got 0x%08x\n", c, ret );
445 }
446}

Referenced by START_TEST().

◆ test_PathMakePretty()

static void test_PathMakePretty ( void  )
static

Definition at line 448 of file path.c.

449{
450 char buff[MAX_PATH];
451
452 ok (PathMakePrettyA(NULL) == FALSE, "PathMakePretty: NULL path succeeded\n");
453 buff[0] = '\0';
454 ok (PathMakePrettyA(buff) == TRUE, "PathMakePretty: Empty path failed\n");
455
456 strcpy(buff, "C:\\A LONG FILE NAME WITH \\SPACES.TXT");
457 ok (PathMakePrettyA(buff) == TRUE, "PathMakePretty: Long UC name failed\n");
458 ok (strcmp(buff, "C:\\a long file name with \\spaces.txt") == 0,
459 "PathMakePretty: Long UC name not changed\n");
460
461 strcpy(buff, "C:\\A LONG FILE NAME WITH \\MixedCase.TXT");
462 ok (PathMakePrettyA(buff) == FALSE, "PathMakePretty: Long MC name succeeded\n");
463 ok (strcmp(buff, "C:\\A LONG FILE NAME WITH \\MixedCase.TXT") == 0,
464 "PathMakePretty: Failed but modified path\n");
465
466 strcpy(buff, "TEST");
467 ok (PathMakePrettyA(buff) == TRUE, "PathMakePretty: Short name failed\n");
468 ok (strcmp(buff, "Test") == 0, "PathMakePretty: 1st char lowercased %s\n", buff);
469}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI PathMakePrettyA(LPSTR lpszPath)
Definition: path.c:2667
static unsigned char buff[32768]
Definition: fatten.c:17

Referenced by START_TEST().

◆ test_PathMatchSpec()

static void test_PathMatchSpec ( void  )
static

Definition at line 471 of file path.c.

472{
473 static const char file[] = "c:\\foo\\bar\\filename.ext";
474 static const char spec1[] = ".ext";
475 static const char spec2[] = "*.ext";
476 static const char spec3[] = "*.ext ";
477 static const char spec4[] = " *.ext";
478 static const char spec5[] = "* .ext";
479 static const char spec6[] = "*. ext";
480 static const char spec7[] = "* . ext";
481 static const char spec8[] = "*.e?t";
482 static const char spec9[] = "filename.ext";
483 static const char spec10[] = "*bar\\filename.ext";
484 static const char spec11[] = " foo; *.ext";
485 static const char spec12[] = "*.ext;*.bar";
486 static const char spec13[] = "*bar*";
487
488 ok (PathMatchSpecA(file, spec1) == FALSE, "PathMatchSpec: Spec1 failed\n");
489 ok (PathMatchSpecA(file, spec2) == TRUE, "PathMatchSpec: Spec2 failed\n");
490 ok (PathMatchSpecA(file, spec3) == FALSE, "PathMatchSpec: Spec3 failed\n");
491 ok (PathMatchSpecA(file, spec4) == TRUE, "PathMatchSpec: Spec4 failed\n");
492 todo_wine ok (PathMatchSpecA(file, spec5) == TRUE, "PathMatchSpec: Spec5 failed\n");
493 todo_wine ok (PathMatchSpecA(file, spec6) == TRUE, "PathMatchSpec: Spec6 failed\n");
494 ok (PathMatchSpecA(file, spec7) == FALSE, "PathMatchSpec: Spec7 failed\n");
495 ok (PathMatchSpecA(file, spec8) == TRUE, "PathMatchSpec: Spec8 failed\n");
496 ok (PathMatchSpecA(file, spec9) == FALSE, "PathMatchSpec: Spec9 failed\n");
497 ok (PathMatchSpecA(file, spec10) == TRUE, "PathMatchSpec: Spec10 failed\n");
498 ok (PathMatchSpecA(file, spec11) == TRUE, "PathMatchSpec: Spec11 failed\n");
499 ok (PathMatchSpecA(file, spec12) == TRUE, "PathMatchSpec: Spec12 failed\n");
500 ok (PathMatchSpecA(file, spec13) == TRUE, "PathMatchSpec: Spec13 failed\n");
501}
BOOL WINAPI PathMatchSpecA(LPCSTR lpszPath, LPCSTR lpszMask)
Definition: path.c:1934
Definition: fci.c:127

Referenced by START_TEST().

◆ test_PathSearchAndQualify()

static void test_PathSearchAndQualify ( void  )
static

Definition at line 216 of file path.c.

217{
218 WCHAR path1[] = {'c',':','\\','f','o','o',0};
219 WCHAR expect1[] = {'c',':','\\','f','o','o',0};
220 WCHAR path2[] = {'c',':','f','o','o',0};
221 WCHAR c_drive[] = {'c',':',0};
222 WCHAR foo[] = {'f','o','o',0};
223 WCHAR path3[] = {'\\','f','o','o',0};
224 WCHAR winini[] = {'w','i','n','.','i','n','i',0};
226 WCHAR cur_dir[MAX_PATH];
227 WCHAR dot[] = {'.',0};
228
229 /* c:\foo */
231 "PathSearchAndQualify rets 0\n");
232 ok(!lstrcmpiW(out, expect1), "strings don't match\n");
233
234 /* c:foo */
236 "PathSearchAndQualify rets 0\n");
237 GetFullPathNameW(c_drive, MAX_PATH, cur_dir, NULL);
238 PathAddBackslashW(cur_dir);
239 lstrcatW(cur_dir, foo);
240 ok(!lstrcmpiW(out, cur_dir), "strings don't match\n");
241
242 /* foo */
244 "PathSearchAndQualify rets 0\n");
245 GetFullPathNameW(dot, MAX_PATH, cur_dir, NULL);
246 PathAddBackslashW(cur_dir);
247 lstrcatW(cur_dir, foo);
248 ok(!lstrcmpiW(out, cur_dir), "strings don't match\n");
249
250 /* \foo */
252 "PathSearchAndQualify rets 0\n");
253 GetFullPathNameW(dot, MAX_PATH, cur_dir, NULL);
254 lstrcpyW(cur_dir + 2, path3);
255 ok(!lstrcmpiW(out, cur_dir), "strings don't match\n");
256
257 /* win.ini */
258 ok(PathSearchAndQualifyW(winini, out, MAX_PATH) != 0,
259 "PathSearchAndQualify rets 0\n");
260 if(!SearchPathW(NULL, winini, NULL, MAX_PATH, cur_dir, NULL))
261 GetFullPathNameW(winini, MAX_PATH, cur_dir, NULL);
262 ok(!lstrcmpiW(out, cur_dir), "strings don't match\n");
263
264}
#define lstrcpyW
Definition: compat.h:749
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:294
BOOL WINAPI PathSearchAndQualifyW(LPCWSTR lpszPath, LPWSTR lpszBuf, UINT cchBuf)
Definition: path.c:3225
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR path3[]
Definition: misc.c:320

Referenced by START_TEST().

◆ test_PathStripPathA()

static void test_PathStripPathA ( void  )
static

Definition at line 1662 of file path.c.

1663{
1664 const char const_path[] = "test";
1665 char path[] = "short//path\\file.txt";
1666
1668 ok(!strcmp(path, "file.txt"), "path = %s\n", path);
1669
1670 /* following test should not crash */
1671 /* LavView 2013 depends on that behaviour */
1672 PathStripPathA((char*)const_path);
1673}
void WINAPI PathStripPathA(LPSTR lpszPath)
Definition: path.c:677

Referenced by START_TEST().

◆ test_PathUnExpandEnvStrings()

static void test_PathUnExpandEnvStrings ( void  )
static

Definition at line 1461 of file path.c.

1462{
1463 static const WCHAR sysrootW[] = {'%','S','y','s','t','e','m','R','o','o','t','%',0};
1464 static const WCHAR sysdriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%',0};
1465 static const WCHAR nonpathW[] = {'p','a','t','h',0};
1466 static const WCHAR computernameW[] = {'C','O','M','P','U','T','E','R','N','A','M','E',0};
1467 static const char sysrootA[] = "%SystemRoot%";
1468 static const char sysdriveA[] = "%SystemDrive%";
1469 WCHAR pathW[MAX_PATH], buffW[MAX_PATH], sysdrvW[3], envvarW[30];
1470 char path[MAX_PATH], buff[MAX_PATH], sysdrvA[3], envvarA[30];
1471 BOOL ret;
1472 UINT len;
1473
1474 if (!pPathUnExpandEnvStringsA || !pPathUnExpandEnvStringsW)
1475 {
1476 win_skip("PathUnExpandEnvStrings not available\n");
1477 return;
1478 }
1479
1480 /* The value of ComputerName is not a path */
1481 ret = GetEnvironmentVariableA("COMPUTERNAME", envvarA, sizeof(envvarA));
1482 ok(ret, "got %d\n", ret);
1483 SetLastError(0xdeadbeef);
1484 ret = pPathUnExpandEnvStringsA(envvarA, buff, sizeof(buff));
1485 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1486
1487 ret = GetEnvironmentVariableW(computernameW, envvarW, ARRAY_SIZE(envvarW));
1488 ok(ret, "got %d\n", ret);
1489 SetLastError(0xdeadbeef);
1490 ret = pPathUnExpandEnvStringsW(envvarW, buffW, ARRAY_SIZE(buffW));
1491 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1492
1493 /* something that can't be represented with env var */
1494 strcpy(path, "somepath_name");
1495 strcpy(buff, "xx");
1496 SetLastError(0xdeadbeef);
1497 ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
1498 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1499 ok(buff[0] == 'x', "wrong return string %s\n", buff);
1500
1502 ok(len > 0, "failed to get sysdir\n");
1503
1504 sysdrvA[0] = path[0];
1505 strcpy(&sysdrvA[1], ":");
1506
1507 /* buffer size is not enough */
1508 strcpy(buff, "xx");
1509 SetLastError(0xdeadbeef);
1510 ret = pPathUnExpandEnvStringsA(path, buff, 5);
1511 ok(!ret && GetLastError() == 0xdeadbeef, "got %d\n", ret);
1512 ok(buff[0] == 'x', "wrong return string %s\n", buff);
1513
1514 /* buffer size is enough to hold variable name only */
1515 strcpy(buff, "xx");
1516 SetLastError(0xdeadbeef);
1517 ret = pPathUnExpandEnvStringsA(path, buff, sizeof(sysrootA));
1518 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1519 ok(buff[0] == 'x', "wrong return string %s\n", buff);
1520
1521 /* enough size */
1522 buff[0] = 0;
1523 ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
1524 ok(ret, "got %d\n", ret);
1525 ok(!strncmp(buff, sysrootA, sizeof(sysrootA)-1), "wrong return string %s\n", buff);
1526
1527 /* expanded value occurs multiple times */
1528 /* for drive C: it unexpands it like 'C:C:' -> '%SystemDrive%C:' */
1529 buff[0] = 0;
1530 strcpy(path, sysdrvA);
1531 strcat(path, sysdrvA);
1532 ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
1533 ok(ret, "got %d\n", ret);
1534 /* expected string */
1535 strcpy(path, sysdriveA);
1536 strcat(path, sysdrvA);
1537 ok(!strcmp(buff, path), "wrong unexpanded string %s, expected %s\n", buff, path);
1538
1539 /* now with altered variable */
1540 ret = GetEnvironmentVariableA("SystemDrive", envvarA, sizeof(envvarA));
1541 ok(ret, "got %d\n", ret);
1542
1543 ret = SetEnvironmentVariableA("SystemDrive", "WW");
1544 ok(ret, "got %d\n", ret);
1545
1546 /* variables are not cached */
1547 strcpy(path, sysdrvA);
1548 strcat(path, sysdrvA);
1549 SetLastError(0xdeadbeef);
1550 ret = pPathUnExpandEnvStringsA(path, buff, sizeof(buff));
1551 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1552
1553 ret = SetEnvironmentVariableA("SystemDrive", envvarA);
1554 ok(ret, "got %d\n", ret);
1555
1556 /* PathUnExpandEnvStringsW */
1557
1558 /* something that can't be represented with env var */
1559 lstrcpyW(pathW, nonpathW);
1560 buffW[0] = 'x'; buffW[1] = 0;
1561 SetLastError(0xdeadbeef);
1562 ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(buffW));
1563 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1564 ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
1565
1567 ok(len > 0, "failed to get sysdir\n");
1568
1569 sysdrvW[0] = pathW[0];
1570 sysdrvW[1] = ':';
1571 sysdrvW[2] = 0;
1572
1573 /* buffer size is not enough */
1574 buffW[0] = 'x'; buffW[1] = 0;
1575 SetLastError(0xdeadbeef);
1576 ret = pPathUnExpandEnvStringsW(pathW, buffW, 5);
1577 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1578 ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
1579
1580 /* buffer size is enough to hold variable name only */
1581 buffW[0] = 'x'; buffW[1] = 0;
1582 SetLastError(0xdeadbeef);
1583 ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(sysrootW));
1584 ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
1585 ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
1586
1587 /* enough size */
1588 buffW[0] = 0;
1589 ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(buffW));
1590 ok(ret, "got %d\n", ret);
1591 ok(!memcmp(buffW, sysrootW, sizeof(sysrootW) - sizeof(WCHAR)), "wrong return string %s\n", wine_dbgstr_w(buffW));
1592
1593 /* expanded value occurs multiple times */
1594 /* for drive C: it unexpands it like 'C:C:' -> '%SystemDrive%C:' */
1595 buffW[0] = 0;
1596 lstrcpyW(pathW, sysdrvW);
1597 lstrcatW(pathW, sysdrvW);
1598 ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(buffW));
1599 ok(ret, "got %d\n", ret);
1600 /* expected string */
1601 lstrcpyW(pathW, sysdriveW);
1602 lstrcatW(pathW, sysdrvW);
1603 ok(!lstrcmpW(buffW, pathW), "wrong unexpanded string %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(pathW));
1604}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:754
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
Definition: environ.c:218
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2283
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
unsigned int UINT
Definition: ndis.h:50

Referenced by START_TEST().

◆ test_PathUnquoteSpaces()

static void test_PathUnquoteSpaces ( void  )
static

Definition at line 1403 of file path.c.

1404{
1405 int i;
1406 for (i = 0; i < ARRAY_SIZE(TEST_PATH_UNQUOTE_SPACES); i++)
1407 {
1411
1413 ok(!strcmp(path, TEST_PATH_UNQUOTE_SPACES[i].result), "%s (A): got %s expected %s\n",
1416
1417 PathUnquoteSpacesW(pathW);
1418 ok(!lstrcmpW(pathW, resultW), "%s (W): strings differ\n",
1420 FreeWideString(pathW);
1421 FreeWideString(resultW);
1423 }
1424}
VOID WINAPI PathUnquoteSpacesA(LPSTR lpszPath)
Definition: path.c:1012
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1034
GLuint64EXT * result
Definition: glext.h:11304
static const struct @1680 TEST_PATH_UNQUOTE_SPACES[]
static LPSTR strdupA(LPCSTR p)
Definition: path.c:205

Referenced by START_TEST().

Variable Documentation

◆ DWORD

Definition at line 30 of file path.c.

◆ expect

BOOL expect

Definition at line 135 of file path.c.

◆ LPCSTR

Definition at line 36 of file path.c.

◆ LPCWSTR

Definition at line 32 of file path.c.

◆ LPDWORD

Definition at line 33 of file path.c.

◆ LPSTR

Definition at line 33 of file path.c.

◆ LPWSTR

Definition at line 34 of file path.c.

◆ path

Definition at line 46 of file path.c.

◆ result

Definition at line 169 of file path.c.

◆ ret

DWORD ret

Definition at line 47 of file path.c.

◆ SHELL_charclass

const DWORD SHELL_charclass[]
static

Definition at line 361 of file path.c.

◆ 

const struct { ... } test_path_is_relative[]
Initial value:
= {
{NULL, TRUE},
{"\0", TRUE},
{"test.txt", TRUE},
{"\\\\folder\\test.txt", FALSE},
{"file://folder/test.txt", TRUE},
{"C:\\test.txt", FALSE},
{"file:///C:/test.txt", TRUE}
}

Referenced by test_PathIsRelativeA(), and test_PathIsRelativeW().

◆ 

struct { ... } TEST_PATH_IS_URL[]
Initial value:
= {
{"http://foo/bar", TRUE},
{"c:\\foo\\bar", FALSE},
{"c:/foo/bar", FALSE},
{"foo://foo/bar", TRUE},
{"foo\\bar", FALSE},
{"foo.bar", FALSE},
{"bogusscheme:", TRUE},
{"http:partial", TRUE},
{"www.winehq.org", FALSE},
{"winehq.org", FALSE},
{"ftp.winehq.org", FALSE},
{"http://winehq.org", TRUE},
{"http://www.winehq.org", TRUE},
{"https://winehq.org", TRUE},
{"https://www.winehq.org", TRUE},
{"ftp://winehq.org", TRUE},
{"ftp://ftp.winehq.org", TRUE},
{"file://does_not_exist.txt", TRUE},
{"about:blank", TRUE},
{"about:home", TRUE},
{"about:mozilla", TRUE},
{"HTTP://www.winehq.org", TRUE},
{" http://www.winehq.org", FALSE},
{"", FALSE},
}

Referenced by test_PathIsUrl().

◆ 

const struct { ... } TEST_PATH_UNQUOTE_SPACES[]
Initial value:
= {
{ "abcdef", "abcdef" },
{ "\"abcdef\"", "abcdef" },
{ "\"abcdef", "\"abcdef" },
{ "abcdef\"", "abcdef\"" },
{ "\"\"abcdef\"\"", "\"abcdef\"" },
{ "abc\"def", "abc\"def" },
{ "\"abc\"def", "\"abc\"def" },
{ "\"abc\"def\"", "abc\"def" },
{ "\'abcdef\'", "\'abcdef\'" },
{ "\"\"", "" },
{ "\"", "" }
}

Referenced by test_PathUnquoteSpaces().

◆ 

const struct { ... } TEST_PATHFROMURL[]

Referenced by test_PathCreateFromUrl().

◆ todo

DWORD todo

Definition at line 47 of file path.c.

Referenced by test_IWbemPath_SetText(), and test_PathCreateFromUrl().

◆ UINT

Definition at line 37 of file path.c.

◆ url

const char* url

Definition at line 45 of file path.c.

Referenced by test_PathCreateFromUrl().