libdom
Loading...
Searching...
No Matches
domtsasserts.h
Go to the documentation of this file.
1/*
2 * This file is part of libdom test suite.
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
6 */
7
8#ifndef domtsasserts_h_
9#define domtsasserts_h_
10
11#include <stdbool.h>
12
13#include <dom/dom.h>
14
15#include "list.h"
16
17
18/* Redefine assert, so we can simply use the standard assert mechanism
19 * within testcases and exit with the right output for the testrunner
20 * to do the right thing. */
21void __assert2(const char *expr, const char *function,
22 const char *file, int line);
23
24#undef assert
25#define assert(expr) \
26 ((void) ((expr) || (__assert2 (#expr, __func__, __FILE__, __LINE__), 0)))
27
28bool is_true(bool arg);
29
30bool is_null(void *arg);
31
32bool is_same(void *excepted, void *actual);
33bool is_same_int(int excepted, int actual);
34bool is_same_unsigned_int32_t(uint32_t excepted, uint32_t actual);
35
36bool is_equals_int(int excepted, int actual, bool dummy);
37bool is_equals_unsigned_int32_t(uint32_t excepted, uint32_t actual, bool dummy);
38bool is_equals_unsigned_long(dom_ulong excepted, dom_ulong actual, bool dummy);
39bool is_equals_bool(bool excepted, bool actual, bool dummy);
40bool is_equals_string(const char *excepted, dom_string *actual,
41 bool ignoreCase);
42bool is_equals_domstring(dom_string *excepted, dom_string *actual, bool ignoreCase);
43
44/* We may use two different string types in libDOM, but the expected string type is
45 always "char *" */
46bool is_equals_list(list *expected, list *actual, bool ignoreCase);
47
48bool is_instanceof(const char *type, dom_node *node);
49
50bool is_size_domnamednodemap(uint32_t size, dom_namednodemap *map);
51bool is_size_domnodelist(uint32_t size, dom_nodelist *list);
52bool is_size_list(uint32_t size, list *list);
53
54bool is_uri_equals(const char *scheme, const char *path, const char *host,
55 const char *file, const char *name, const char *query,
56 const char *fragment, const char *isAbsolute,
57 dom_string *actual);
58
59bool is_contenttype(const char *type);
60
61bool has_feature(const char *feature, const char *version);
62
63bool implementation_attribute(char *name, bool value);
64
65#endif
bool is_contenttype(const char *type)
Definition domtsasserts.c:349
bool is_equals_int(int excepted, int actual, bool dummy)
Definition domtsasserts.c:58
bool is_equals_bool(bool excepted, bool actual, bool dummy)
Definition domtsasserts.c:65
bool is_size_list(uint32_t size, list *list)
Definition domtsasserts.c:198
bool is_same_unsigned_int32_t(uint32_t excepted, uint32_t actual)
Definition domtsasserts.c:53
bool implementation_attribute(char *name, bool value)
Definition domtsasserts.c:380
bool is_null(void *arg)
Definition domtsasserts.c:38
bool is_size_domnamednodemap(uint32_t size, dom_namednodemap *map)
Definition domtsasserts.c:170
void __assert2(const char *expr, const char *function, const char *file, int line)
Definition domtsasserts.c:17
bool is_equals_string(const char *excepted, dom_string *actual, bool ignoreCase)
Definition domtsasserts.c:93
bool is_same(void *excepted, void *actual)
Definition domtsasserts.c:43
bool is_size_domnodelist(uint32_t size, dom_nodelist *list)
Definition domtsasserts.c:184
bool is_equals_list(list *expected, list *actual, bool ignoreCase)
Definition domtsasserts.c:126
bool is_uri_equals(const char *scheme, const char *path, const char *host, const char *file, const char *name, const char *query, const char *fragment, const char *isAbsolute, dom_string *actual)
Definition domtsasserts.c:204
bool is_equals_domstring(dom_string *excepted, dom_string *actual, bool ignoreCase)
Definition domtsasserts.c:115
bool is_instanceof(const char *type, dom_node *node)
Definition domtsasserts.c:159
bool has_feature(const char *feature, const char *version)
Definition domtsasserts.c:359
bool is_equals_unsigned_int32_t(uint32_t excepted, uint32_t actual, bool dummy)
Definition domtsasserts.c:72
bool is_true(bool arg)
Definition domtsasserts.c:33
bool is_same_int(int excepted, int actual)
Definition domtsasserts.c:48
bool is_equals_unsigned_long(dom_ulong excepted, dom_ulong actual, bool dummy)
Definition domtsasserts.c:79
uint32_t dom_ulong
Definition inttypes.h:31
Definition namednodemap.c:26
Definition node.h:79
Definition nodelist.c:26
Definition string.h:19
Definition list.h:33