ReactOS 0.4.15-dev-7670-g69b08be
name.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "windns.h"
#include "wine/test.h"
Include dependency graph for name.c:

Go to the source code of this file.

Functions

BOOL WINAPI DnsFlushResolverCacheEntry_A (PCSTR)
 
static void test_DnsValidateName_A (void)
 
static void test_DnsNameCompare_A (void)
 
static void test_DnsFlushResolverCacheEntry_A (void)
 
 START_TEST (name)
 

Variables

struct {
   LPCSTR   name
 
   DNS_NAME_FORMAT   format
 
   DNS_STATUS   status
 
   DNS_STATUS   status_broken
 
test_data []
 

Function Documentation

◆ DnsFlushResolverCacheEntry_A()

BOOL WINAPI DnsFlushResolverCacheEntry_A ( PCSTR  )

◆ START_TEST()

START_TEST ( name  )

Definition at line 225 of file name.c.

226{
230}
static void test_DnsNameCompare_A(void)
Definition: name.c:157
static void test_DnsValidateName_A(void)
Definition: name.c:141
static void test_DnsFlushResolverCacheEntry_A(void)
Definition: name.c:207

◆ test_DnsFlushResolverCacheEntry_A()

static void test_DnsFlushResolverCacheEntry_A ( void  )
static

Definition at line 207 of file name.c.

208{
209 BOOL ret;
210 DWORD err;
211
212 SetLastError( 0xdeadbeef );
214 err = GetLastError();
215 ok( !ret, "got %d\n", ret );
216 ok( err == 0xdeadbeef, "got %u\n", err );
217
218 ret = DnsFlushResolverCacheEntry_A( "localhost" );
219 ok( ret, "got %d\n", ret );
220
221 ret = DnsFlushResolverCacheEntry_A( "nxdomain.test.winehq.org" );
222 ok( ret, "got %d\n", ret );
223}
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI DnsFlushResolverCacheEntry_A(PCSTR)
#define err(...)
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by START_TEST().

◆ test_DnsNameCompare_A()

static void test_DnsNameCompare_A ( void  )
static

Definition at line 157 of file name.c.

158{
159 static const CHAR empty[] = "",
160 dot[] = ".",
161 dotdot[] = "..",
162 A[] = "A",
163 a[] = "a",
164 B[] = "B",
165 b[] = "b",
166 A_dot_B[] = "A.B",
167 a_dot_a[] = "a.a",
168 a_dot_b[] = "a.b",
169 a_dot_b_dot[] = "a.b.",
170 a_dot_b_dotdot[] = "a.b..",
171 B_dot_A[] = "B.A",
172 b_dot_a[] = "b.a",
173 b_dot_a_dot[] = "b.a.",
174 b_dot_a_dotdot[] = "b.a..";
175
176 ok( DnsNameCompare_A( NULL, NULL ) == TRUE, "failed unexpectedly\n" );
177
178 ok( DnsNameCompare_A( empty, empty ) == TRUE, "failed unexpectedly\n" );
179 ok( DnsNameCompare_A( dot, empty ) == TRUE, "failed unexpectedly\n" );
180 ok( DnsNameCompare_A( empty, dot ) == TRUE, "failed unexpectedly\n" );
181 ok( DnsNameCompare_A( dot, dotdot ) == TRUE, "failed unexpectedly\n" );
182 ok( DnsNameCompare_A( dotdot, dot ) == TRUE, "failed unexpectedly\n" );
183 ok( DnsNameCompare_A( a, a ) == TRUE, "failed unexpectedly\n" );
184 ok( DnsNameCompare_A( a, A ) == TRUE, "failed unexpectedly\n" );
185 ok( DnsNameCompare_A( A, a ) == TRUE, "failed unexpectedly\n" );
186 ok( DnsNameCompare_A( a_dot_b, A_dot_B ) == TRUE, "failed unexpectedly\n" );
187 ok( DnsNameCompare_A( a_dot_b, a_dot_b ) == TRUE, "failed unexpectedly\n" );
188 ok( DnsNameCompare_A( a_dot_b_dot, a_dot_b_dot ) == TRUE, "failed unexpectedly\n" );
189 ok( DnsNameCompare_A( a_dot_b_dotdot, a_dot_b_dotdot ) == TRUE, "failed unexpectedly\n" );
190
191 ok( DnsNameCompare_A( empty, NULL ) == FALSE, "succeeded unexpectedly\n" );
192 ok( DnsNameCompare_A( NULL, empty ) == FALSE, "succeeded unexpectedly\n" );
193
194 ok( DnsNameCompare_A( a, b ) == FALSE, "succeeded unexpectedly\n" );
195 ok( DnsNameCompare_A( a, B ) == FALSE, "succeeded unexpectedly\n" );
196 ok( DnsNameCompare_A( A, b ) == FALSE, "succeeded unexpectedly\n" );
197 ok( DnsNameCompare_A( a_dot_b, B_dot_A ) == FALSE, "succeeded unexpectedly\n" );
198 ok( DnsNameCompare_A( a_dot_b_dot, b_dot_a_dot ) == FALSE, "succeeded unexpectedly\n" );
199 ok( DnsNameCompare_A( a_dot_b, a_dot_a ) == FALSE, "succeeded unexpectedly\n" );
200 ok( DnsNameCompare_A( a_dot_b_dotdot, b_dot_a_dotdot ) == FALSE, "succeeded unexpectedly\n" );
201 ok( DnsNameCompare_A( a_dot_b_dot, b_dot_a_dotdot ) == FALSE, "succeeded unexpectedly\n" );
202 ok( DnsNameCompare_A( a_dot_b_dotdot, b_dot_a_dot ) == FALSE, "succeeded unexpectedly\n" );
203 ok( DnsNameCompare_A( a_dot_b_dot, b_dot_a ) == FALSE, "succeeded unexpectedly\n" );
204 ok( DnsNameCompare_A( a_dot_b, b_dot_a_dot ) == FALSE, "succeeded unexpectedly\n" );
205}
Definition: ehthrow.cxx:93
Definition: ehthrow.cxx:54
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR empty[]
Definition: main.c:47
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
BOOL WINAPI DnsNameCompare_A(LPCSTR name1, LPCSTR name2)
Definition: names.c:31
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ test_DnsValidateName_A()

static void test_DnsValidateName_A ( void  )
static

Definition at line 141 of file name.c.

142{
143 unsigned int i;
144 DNS_STATUS status;
145
147 ok( status == ERROR_INVALID_NAME, "succeeded unexpectedly\n" );
148
149 for (i = 0; i < ARRAY_SIZE(test_data); i++)
150 {
153 "%d: \'%s\': got %d, expected %d\n", i, test_data[i].name, status, test_data[i].status );
154 }
155}
#define broken(x)
Definition: _sntprintf.h:21
#define ARRAY_SIZE(A)
Definition: main.h:33
#define ERROR_INVALID_NAME
Definition: compat.h:103
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
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
DNS_STATUS status_broken
Definition: name.c:37
DNS_STATUS status
Definition: name.c:36
DNS_STATUS WINAPI DnsValidateName_A(PCSTR name, DNS_NAME_FORMAT format)
Definition: names.c:81
Definition: name.c:39
Definition: ps.c:97
@ DnsNameDomain
Definition: windns.h:144

Referenced by START_TEST().

Variable Documentation

◆ format

Definition at line 35 of file name.c.

◆ name

Definition at line 34 of file name.c.

◆ status

Definition at line 36 of file name.c.

Referenced by test_DnsValidateName_A().

◆ status_broken

DNS_STATUS status_broken

Definition at line 37 of file name.c.

Referenced by test_DnsValidateName_A().

◆ 

const struct { ... } test_data[]