|
FreeRDP
|
4 #include <winpr/file.h>
5 #include <winpr/windows.h>
7 int TestFilePatternMatch(
int argc,
char* argv[])
12 if (!FilePatternMatchA(
"document.txt",
"*"))
14 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.txt",
"*");
20 if (!FilePatternMatchA(
"document.txt",
"*.txt"))
22 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.txt",
"*.txt");
26 if (FilePatternMatchA(
"document.docx",
"*.txt"))
28 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.docx",
"*.txt");
32 if (FilePatternMatchA(
"document.txt.bak",
"*.txt"))
34 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.txt.bak",
"*.txt");
38 if (FilePatternMatchA(
"bak",
"*.txt"))
40 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"bak",
"*.txt");
46 if (!FilePatternMatchA(
"document.txt",
"document.*"))
48 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.txt",
"document.*");
54 if (!FilePatternMatchA(
"document.docx",
"document.doc?"))
56 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.docx",
61 if (FilePatternMatchA(
"document.doc",
"document.doc?"))
63 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.doc",
70 if (!FilePatternMatchA(
"document.txt",
"document.txt"))
72 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"document.txt",
79 if (!FilePatternMatchA(
"X123Y.txt",
"X*Y.txt"))
81 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Y.txt",
"X*Y.txt");
85 if (!FilePatternMatchA(
"XY.txt",
"X*Y.txt"))
87 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XY.txt",
"X*Y.txt");
91 if (FilePatternMatchA(
"XZ.txt",
"X*Y.txt"))
93 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XZ.txt",
"X*Y.txt");
97 if (FilePatternMatchA(
"X123Z.txt",
"X*Y.txt"))
99 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Z.txt",
"X*Y.txt");
105 if (!FilePatternMatchA(
"X123Y456Z.txt",
"X*Y*Z.txt"))
107 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Y456Z.txt",
"X*Y*Z.txt");
111 if (!FilePatternMatchA(
"XYZ.txt",
"X*Y*Z.txt"))
113 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XYZ.txt",
"X*Y*Z.txt");
117 if (!FilePatternMatchA(
"X123Y456W.txt",
"X*Y*Z.txt"))
119 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Y456W.txt",
"X*Y*Z.txt");
123 if (!FilePatternMatchA(
"XYW.txt",
"X*Y*Z.txt"))
125 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XYW.txt",
"X*Y*Z.txt");
131 if (!FilePatternMatchA(
"X1Y.txt",
"X?Y.txt"))
133 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X1Y.txt",
"X?Y.txt");
137 if (FilePatternMatchA(
"XY.txt",
"X?Y.txt"))
139 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XY.txt",
"X?Y.txt");
143 if (FilePatternMatchA(
"XZ.txt",
"X?Y.txt"))
145 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XZ.txt",
"X?Y.txt");
149 if (FilePatternMatchA(
"X123Z.txt",
"X?Y.txt"))
151 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Z.txt",
"X?Y.txt");
157 if (!FilePatternMatchA(
"X123Y456Z.txt",
"X?Y?Z.txt"))
159 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Y456Z.txt",
"X?Y?Z.txt");
163 if (FilePatternMatchA(
"XYZ.txt",
"X?Y?Z.txt"))
165 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XYZ.txt",
"X?Y?Z.txt");
169 if (!FilePatternMatchA(
"X123Y456W.txt",
"X?Y?Z.txt"))
171 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"X123Y456W.txt",
"X?Y?Z.txt");
175 if (FilePatternMatchA(
"XYW.txt",
"X?Y?Z.txt"))
177 printf(
"FilePatternMatchA error: FileName: %s Pattern: %s\n",
"XYW.txt",
"X?Y?Z.txt");