ReactOS 0.4.15-dev-7961-gdcf9eb0
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);
15 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:\\TestTestTest"), TRUE);
18 ok_int(PathIsEqualOrSubFolder(L"C:\\TestTestTest", L"C:\\"), FALSE);
19 ok_int(PathIsEqualOrSubFolder(L"C:\\TestTestTest", L"C:\\TestTestTest"), TRUE);
20 ok_int(PathIsEqualOrSubFolder(L"C:\\TestTestTest", L"C:\\TestTestTest\\"), TRUE);
21
22 WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH];
23
24 GetWindowsDirectoryW(szPath1, _countof(szPath1));
25 ok_int(PathIsEqualOrSubFolder(szPath1, szPath1), TRUE);
26
27 GetWindowsDirectoryW(szPath2, _countof(szPath2));
28 PathAppendW(szPath2, L"TestTestTest");
29
30 ok_int(PathIsEqualOrSubFolder(szPath1, szPath2), TRUE);
31 ok_int(PathIsEqualOrSubFolder(szPath2, szPath1), FALSE);
32 ok_int(PathIsEqualOrSubFolder(szPath2, szPath2), TRUE);
33
34 GetTempPathW(_countof(szPath1), szPath1);
35 GetTempPathW(_countof(szPath2), szPath2);
36 PathAppendW(szPath2, L"TestTestTest");
37
38 ok_int(PathIsEqualOrSubFolder(szPath1, szPath2), TRUE);
39 ok_int(PathIsEqualOrSubFolder(szPath2, szPath1), FALSE);
40 ok_int(PathIsEqualOrSubFolder(szPath2, szPath2), TRUE);
41}
#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:1219
#define L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
#define _countof(array)
Definition: sndvol32.h:68
__wchar_t WCHAR
Definition: xmlstorage.h:180