]>
git.ipfire.org Git - thirdparty/squid.git/blob - test-suite/test_tools.cc
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 // XXX: This file is made of large pieces of src/tools.cc
10 // with only a few minor modifications. TODO: redesign or delete.
17 xassert(const char *msg
, const char *file
, int line
)
19 std::cout
<< "Assertion failed: (" << msg
<< ") at " << file
<< ":" << line
<< std::endl
;
26 return new dlink_node
;
29 /* the node needs to be unlinked FIRST */
31 dlinkNodeDelete(dlink_node
* m
)
40 dlinkAdd(void *data
, dlink_node
* m
, dlink_list
* list
)
51 if (list
->tail
== NULL
)
56 dlinkAddAfter(void *data
, dlink_node
* m
, dlink_node
* n
, dlink_list
* list
)
65 assert(list
->tail
== n
);
73 dlinkAddTail(void *data
, dlink_node
* m
, dlink_list
* list
)
84 if (list
->head
== NULL
)
89 dlinkDelete(dlink_node
* m
, dlink_list
* list
)
92 m
->next
->prev
= m
->prev
;
95 m
->prev
->next
= m
->next
;
101 list
->tail
= m
->prev
;
103 m
->next
= m
->prev
= NULL
;