ReactOS 0.4.16-dev-257-g6aa11ac
test_dns.c
Go to the documentation of this file.
1#include "test_dns.h"
2
3#include "lwip/dns.h"
4
5/* Setups/teardown functions */
6
7static void
9{
10}
11
12static void
14{
15}
16
17/* Test functions */
18
19START_TEST(test_dns_set_get_server)
20{
21 int n;
23
24 for (n = 0; n < 256; n++) {
25 u8_t i = (u8_t)n;
27 /* Should return a zeroed address for any index */
28 fail_unless(dns_getserver(i));
29 fail_unless(ip_addr_isany(dns_getserver(i)));
30
31 /* Should accept setting address for any index, and ignore if out of range */
32 IP_ADDR4(&server, 10, 0, 0, i);
33 dns_setserver(i, &server);
34 fail_unless(dns_getserver(i));
35 if (i < DNS_MAX_SERVERS) {
36 fail_unless(ip_addr_eq(dns_getserver(i), &server) == 1);
37 } else {
38 fail_unless(ip_addr_isany(dns_getserver(i)));
39 }
40 }
41}
42END_TEST
43
45Suite *
47{
48 testfunc tests[] = {
49 TESTFUNC(test_dns_set_get_server)
50 };
51 return create_suite("DNS", tests, sizeof(tests)/sizeof(testfunc), dns_setup, dns_teardown);
52}
#define START_TEST(x)
Definition: atltest.h:75
GLdouble n
Definition: glext.h:7729
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
uint8_t u8_t
Definition: arch.h:125
#define LWIP_UNUSED_ARG(x)
Definition: arch.h:373
#define DNS_MAX_SERVERS
Definition: opt.h:1153
#define ip_addr_isany(ipaddr)
Definition: ip_addr.h:377
#define ip_addr_eq(addr1, addr2)
Definition: ip_addr.h:374
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
Suite * create_suite(const char *name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
#define TESTFUNC(x)
Definition: lwip_check.h:22
static struct test_info tests[]
END_TEST Suite * dns_suite(void)
Definition: test_dns.c:46
static void dns_setup(void)
Definition: test_dns.c:8
static void dns_teardown(void)
Definition: test_dns.c:13
static rfbScreenInfoPtr server
Definition: vnc.c:74