Squid Web Cache v8/master
Loading...
Searching...
No Matches
STUB.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9#ifndef SQUID_SRC_TESTS_STUB_H
10#define SQUID_SRC_TESTS_STUB_H
11
28#include <iostream>
29
30// Internal Special: the STUB framework requires this function
31#define stub_fatal(m) { std::cerr<<"FATAL: "<<(m)<<" for use of "<<__func__<<"\n"; exit(EXIT_FAILURE); }
32
34#define STUB { stub_fatal(STUB_API " required"); }
35
38#define STUB_NOP { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; }
39
42#define STUB_RETVAL(x) { stub_fatal(STUB_API " required"); return x; }
43
46#define STUB_RETVAL_NOP(x) { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; return x; }
47
52#define STUB_RETREF(x) { stub_fatal(STUB_API " required"); return *(x *)nullptr; }
53
55#define STUB_RETSTATREF(x) STUB_RETREF(x)
56
57#endif /* SQUID_SRC_TESTS_STUB_H */
58