Lolly 1.4.28
Loading...
Searching...
No Matches
lolly_doctests.hpp
Go to the documentation of this file.
1#ifndef LOLLY_TBOX_MACROS_H
2#define LOLLY_TBOX_MACROS_H
3
4#include "doctest/doctest.h"
7#include "string.hpp"
8#include "url.hpp"
9
12
13inline void
14string_eq (string left, string right) {
15 if (left != right) {
16 cout << "left : " << left << LF;
17 cout << "right: " << right << LF;
18 }
19 CHECK_EQ (left == right, true);
20}
21
22inline void
23string_neq (string left, string right) {
24 if (left == right) {
25 cout << "same: " << left << LF;
26 }
27 CHECK_EQ (left != right, true);
28}
29
30inline void
32 if (left != right) {
33 cout << "left : " << left << LF;
34 cout << "right: " << right << LF;
35 }
36 CHECK_EQ (left == right, true);
37}
38
39inline void
41 if (left == right) {
42 cout << "same: " << left << LF;
43 }
44 CHECK_EQ (left != right, true);
45}
46
47#define TM_CHECK_THROWS(statements) \
48 CHECK_THROWS (statements); \
49 handle_exceptions ();
50
51#define TEST_MEMORY_LEAK_ALL \
52 TEST_CASE ("test memory leak above") { CHECK_EQ (mem_used (), mem_lolly); }
53
54#define TEST_MEMORY_LEAK_INIT \
55 int mem_lolly= 0; \
56 TEST_CASE ("read before test") { mem_lolly= mem_used (); }
57
58#define TEST_MEMORY_LEAK_RESET \
59 TEST_CASE ("reset test of memory leak") { mem_lolly= mem_used (); }
60
61#endif
@ LF
Definition basic.hpp:287
The list class represents a linked list.
Definition list.hpp:48
Definition url.hpp:37
void url_eq(url left, url right)
void string_eq(string left, string right)
void url_neq(url left, url right)
void string_neq(string left, string right)
tm_ostream & cout