Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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. */
  21. void __assert2(const char *expr, const char *function,
  22.                 const char *file, int line);
  23.  
  24. #define assert(expr) \
  25.   ((void) ((expr) || (__assert2 (#expr, __func__, __FILE__, __LINE__), 0)))
  26.  
  27. bool is_true(bool arg);
  28.  
  29. bool is_null(void *arg);
  30.  
  31. bool is_same(void *excepted, void *actual);
  32. bool is_same_int(int excepted, int actual);
  33. bool is_same_unsigned_int32_t(uint32_t excepted, uint32_t actual);
  34.  
  35. bool is_equals_int(int excepted, int actual, bool dummy);
  36. bool is_equals_unsigned_int32_t(uint32_t excepted, uint32_t actual, bool dummy);
  37. bool is_equals_bool(bool excepted, bool actual, bool dummy);
  38. bool is_equals_string(const char *excepted, dom_string *actual,
  39.                 bool ignoreCase);
  40. bool is_equals_domstring(dom_string *excepted, dom_string *actual, bool ignoreCase);
  41.  
  42. /* We may use two different string types in libDOM, but the expected string type is
  43.    always "char *" */
  44. bool is_equals_list(list *expected, list *actual, bool ignoreCase);
  45.  
  46. bool is_instanceof(const char *type, dom_node *node);
  47.  
  48. bool is_size_domnamednodemap(uint32_t size, dom_namednodemap *map);
  49. bool is_size_domnodelist(uint32_t size, dom_nodelist *list);
  50. bool is_size_list(uint32_t size, list *list);
  51.  
  52. bool is_uri_equals(const char *scheme, const char *path, const char *host,
  53.                    const char *file, const char *name, const char *query,
  54.                    const char *fragment, const char *isAbsolute,
  55.                    dom_string *actual);
  56.  
  57. bool is_contenttype(const char *type);
  58.  
  59. bool has_feature(const char *feature, const char *version);
  60.  
  61. bool implementation_attribute(char *name, bool value);
  62.  
  63. #endif
  64.