ReactOS 0.4.16-dev-597-gdbf7844
IsValidInstallDirectory.c File Reference
#include "precomp.h"
Include dependency graph for IsValidInstallDirectory.c:

Go to the source code of this file.

Macros

#define BOOL_TO_STR(b)   ((b) ? "TRUE" : "FALSE")
 

Functions

 START_TEST (IsValidInstallDirectory)
 

Macro Definition Documentation

◆ BOOL_TO_STR

#define BOOL_TO_STR (   b)    ((b) ? "TRUE" : "FALSE")

Function Documentation

◆ START_TEST()

START_TEST ( IsValidInstallDirectory  )

Definition at line 13 of file IsValidInstallDirectory.c.

14{
15 static const struct
16 {
19 } tests[] =
20 {
21 { L"", FALSE },
22 { L" ", FALSE },
23 { L"\\", FALSE },
24 { L"\\\\", FALSE },
25 { L".", FALSE },
26 { L"..", FALSE },
27 { L"...", FALSE },
28 { L"....", FALSE },
29 { L" WINNT", FALSE },
30 { L"WINNT ", FALSE },
31 { L".WINNT", FALSE },
32 { L"..WINNT", FALSE },
33 { L"W.INNT", FALSE },
34 { L"WI.NNT", TRUE },
35 { L"WIN.NT", TRUE },
36 { L"WINNT.", TRUE },
37 { L"WINNT..", FALSE },
38 { L"WINNT. ", FALSE },
39 { L"WINNT.e e", FALSE },
40 { L"WIN^`NT", FALSE },
41
42 { L"WINNT", TRUE },
43 { L"\\WINNT", TRUE },
44 { L"\\WINNT\\", TRUE },
45 { L"\\WINNT\\.", FALSE },
46 { L"WIN\\NT", TRUE },
47 { L"WIN\\NT.", TRUE },
48 { L"\\WIN\\NT\\", TRUE },
49 { L"\\WIN\\NT.\\", TRUE },
50 { L"\\WIN.\\NT52", TRUE },
51 { L"\\WIN\\.\\NT52", FALSE },
52 { L"\\WIN\\..\\NT52", FALSE },
53 { L"\\WIN\\...\\NT52", FALSE },
54 { L"\\WIN\\....\\NT52", FALSE },
55
56 { L"win.nt.5", FALSE },
57 { L"win.ntX5", FALSE },
58 { L"winn.tX5", TRUE },
59 { L"winnt.X5", TRUE },
60 { L"winntX.5", TRUE },
61 { L"winntX5.", TRUE },
62 { L"filenamee.xte", FALSE },
63 { L"filenamee.xt", FALSE },
64 { L"filename.ext", TRUE },
65 { L"file.ame.ext", FALSE },
66 { L"filenam.eext", FALSE },
67
68 { L"1 3 5 7 .abc", FALSE },
69 { L"12345678. c", FALSE },
70 { L"123456789.a", FALSE },
71 { L"12345.abcd", FALSE },
72 { L"12345.ab d", FALSE },
73 { L".abc", FALSE },
74 { L"12.abc.d", FALSE },
75 { L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", FALSE },
76 };
77
78#define BOOL_TO_STR(b) ((b) ? "TRUE" : "FALSE")
79
80 UINT i;
81 for (i = 0; i < _countof(tests); ++i)
82 {
84 ok(ret == tests[i].result,
85 "Unexpected result for '%S', got %s, expected %s\n",
87 }
88
89#undef BOOL_TO_STR
90}
#define BOOL_TO_STR(b)
unsigned char BOOLEAN
#define ok(value,...)
Definition: atltest.h:57
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLuint64EXT * result
Definition: glext.h:11304
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
static struct test_info tests[]
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
BOOLEAN NTAPI IsValidInstallDirectory(_In_ PCWSTR InstallDir)
Verify whether the given directory is suitable for ReactOS installation. Each path component must be ...
Definition: setuplib.c:778
#define _countof(array)
Definition: sndvol32.h:70
const uint16_t * PCWSTR
Definition: typedefs.h:57
int ret