4 #include <winpr/path.h>
5 #include <winpr/tchar.h>
6 #include <winpr/winpr.h>
8 static const TCHAR testBasePathBackslash[] = _T(
"C:\\Program Files\\");
9 static const TCHAR testBasePathNoBackslash[] = _T(
"C:\\Program Files");
10 static const TCHAR testMorePathBackslash[] = _T(
"\\Microsoft Visual Studio 11.0");
11 static const TCHAR testMorePathNoBackslash[] = _T(
"Microsoft Visual Studio 11.0");
12 static const TCHAR testPathOut[] = _T(
"C:\\Program Files\\Microsoft Visual Studio 11.0");
13 static const TCHAR testPathOutMorePathBackslash[] = _T(
"C:\\Microsoft Visual Studio 11.0");
15 int TestPathAllocCombine(
int argc,
char* argv[])
18 LPTSTR PathOut = NULL;
25 status = PathAllocCombine(testBasePathBackslash, testMorePathNoBackslash, 0, &PathOut);
29 _tprintf(_T(
"PathAllocCombine status: 0x%08") _T(PRIX32) _T(
"\n"), status);
33 if (_tcscmp(PathOut, testPathOut) != 0)
35 _tprintf(_T(
"Path Mismatch 1: Actual: %s, Expected: %s\n"), PathOut, testPathOut);
43 status = PathAllocCombine(testBasePathBackslash, testMorePathBackslash, 0, &PathOut);
47 _tprintf(_T(
"PathAllocCombine status: 0x%08") _T(PRIX32) _T(
"\n"), status);
51 if (_tcscmp(PathOut, testPathOutMorePathBackslash) != 0)
53 _tprintf(_T(
"Path Mismatch 2: Actual: %s, Expected: %s\n"), PathOut,
54 testPathOutMorePathBackslash);
62 status = PathAllocCombine(testBasePathNoBackslash, testMorePathBackslash, 0, &PathOut);
66 _tprintf(_T(
"PathAllocCombine status: 0x%08") _T(PRIX32) _T(
"\n"), status);
70 if (_tcscmp(PathOut, testPathOutMorePathBackslash) != 0)
72 _tprintf(_T(
"Path Mismatch 3: Actual: %s, Expected: %s\n"), PathOut,
73 testPathOutMorePathBackslash);
81 status = PathAllocCombine(testBasePathNoBackslash, testMorePathNoBackslash, 0, &PathOut);
85 _tprintf(_T(
"PathAllocCombine status: 0x%08") _T(PRIX32) _T(
"\n"), status);
89 if (_tcscmp(PathOut, testPathOut) != 0)
91 _tprintf(_T(
"Path Mismatch 4: Actual: %s, Expected: %s\n"), PathOut, testPathOut);