]>
git.ipfire.org Git - thirdparty/squid.git/blob - test-suite/test_tools.cc
2 * Copyright (C) 1996-2018 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
;
24 dlinkAdd(void *data
, dlink_node
* m
, dlink_list
* list
)
35 if (list
->tail
== NULL
)
40 dlinkAddAfter(void *data
, dlink_node
* m
, dlink_node
* n
, dlink_list
* list
)
49 assert(list
->tail
== n
);
57 dlinkAddTail(void *data
, dlink_node
* m
, dlink_list
* list
)
68 if (list
->head
== NULL
)
73 dlinkDelete(dlink_node
* m
, dlink_list
* list
)
76 m
->next
->prev
= m
->prev
;
79 m
->prev
->next
= m
->next
;
87 m
->next
= m
->prev
= NULL
;