]> git.ipfire.org Git - thirdparty/squid.git/blame - test-suite/debug.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / test-suite / debug.cc
CommitLineData
f95fe6ed 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
26ac0430 3 *
4e0938ef
AJ
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.
f95fe6ed 7 */
8
4e0938ef
AJ
9/* DEBUG: section 19 Store Memory Primitives */
10
582c2af2
FC
11#include "squid.h"
12#include "Debug.h"
f95fe6ed 13#include "mem_node.h"
582c2af2 14#include "stmem.h"
f95fe6ed 15
26ac0430
AJ
16class StreamTest
17{
18public:
f95fe6ed 19 std::ostream &serialise(std::ostream &);
58c0b17d 20 int getAnInt() const;
f95fe6ed 21 char const *getACString() const;
22};
23
24std::ostream &operator << (std::ostream &aStream, StreamTest &anObject)
25{
26 return anObject.serialise(aStream);
27}
28
29std::ostream&
30StreamTest::serialise(std::ostream &aStream)
31{
32 aStream << "stream test";
33 return aStream;
34}
35
58c0b17d 36int
f95fe6ed 37StreamTest::getAnInt() const
38{
d219c387 39 return 5;
f95fe6ed 40}
41
42char const *
43StreamTest::getACString() const
44{
45 return "ThisIsAStreamTest";
46}
47
48int
72ed5979 49main(int, char *[])
f95fe6ed 50{
51 Debug::Levels[1] = 8;
52 debugs (1,1,"test" << "string");
61beade2 53 debugs (1,9,"do not show this" << "string");
f95fe6ed 54 debugs (1,1,"test" << "string");
55 debugs (1,1,"test" << "string");
56 if (true)
26ac0430 57 debugs(1,9,"this won't compile if the macro is broken.");
f95fe6ed 58 else
e0236918 59 debugs(1, DBG_IMPORTANT,"bar");
f95fe6ed 60 StreamTest aStreamObject;
61 StreamTest *streamPointer (&aStreamObject);
e0236918
FC
62 debugs(1, DBG_IMPORTANT,aStreamObject);
63 debugs(1, DBG_IMPORTANT,streamPointer->getAnInt() << " " << aStreamObject.getACString());
24885773 64 return EXIT_SUCCESS;
f95fe6ed 65}
f53969cc 66