ReactOS 0.4.16-dev-1946-g52006dd
PathIsEqualOrSubFolder.cpp File Reference
#include "shelltest.h"
#include <undocshell.h>
Include dependency graph for PathIsEqualOrSubFolder.cpp:

Go to the source code of this file.

Functions

 START_TEST (PathIsEqualOrSubFolder)
 

Function Documentation

◆ START_TEST()

START_TEST ( PathIsEqualOrSubFolder  )

Definition at line 11 of file PathIsEqualOrSubFolder.cpp.

12{
14 ok_int(PathIsEqualOrSubFolder(L"C:", L"C:\\"), TRUE);
16 ok_int(PathIsEqualOrSubFolder(L"C:\\", L"C:"), TRUE);
17 ok_int(PathIsEqualOrSubFolder(L"C:\\", L"C:\\"), TRUE);
18 ok_int(PathIsEqualOrSubFolder(L"C:\\", L"C:\\TestTestTest"), TRUE);
19 ok_int(PathIsEqualOrSubFolder(L"C:\\TestTestTest", L"C:\\"), FALSE);
20 ok_int(PathIsEqualOrSubFolder(L"C:\\TestTestTest", L"C:\\TestTestTest"), TRUE);
21 ok_int(PathIsEqualOrSubFolder(L"C:\\TestTestTest", L"C:\\TestTestTest\\"), TRUE);
22
23 WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH];
24
25 GetWindowsDirectoryW(szPath1, _countof(szPath1));
26 ok_int(PathIsEqualOrSubFolder(szPath1, szPath1), TRUE);
27
28 GetWindowsDirectoryW(szPath2, _countof(szPath2));
29 PathAppendW(szPath2, L"TestTestTest");
30
31 ok_int(PathIsEqualOrSubFolder(szPath1, szPath2), TRUE);
32 ok_int(PathIsEqualOrSubFolder(szPath2, szPath1), FALSE);
33 ok_int(PathIsEqualOrSubFolder(szPath2, szPath2), TRUE);
34
35 GetTempPathW(_countof(szPath1), szPath1);
36 GetTempPathW(_countof(szPath2), szPath2);
37 PathAppendW(szPath2, L"TestTestTest");
38
39 ok_int(PathIsEqualOrSubFolder(szPath1, szPath2), TRUE);
40 ok_int(PathIsEqualOrSubFolder(szPath2, szPath1), FALSE);
41 ok_int(PathIsEqualOrSubFolder(szPath2, szPath2), TRUE);
42}
#define GetNTVersion()
Definition: apitest.h:17
#define ok_int(expression, result)
Definition: atltest.h:134
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
EXTERN_C BOOL WINAPI PathIsEqualOrSubFolder(_In_ LPCWSTR pszPath1OrCSIDL, _In_ LPCWSTR pszPath2)
Definition: utils.cpp:1612
#define L(x)
Definition: resources.c:13
#define PathAppendW
Definition: pathcch.h:310
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
#define _countof(array)
Definition: sndvol32.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180