#include <iostream>
![](STUB_8h__incl.png)
Go to the source code of this file.
Macros | |
#define | stub_fatal(m) { std::cerr<<"FATAL: "<<(m)<<" for use of "<<__func__<<"\n"; exit(EXIT_FAILURE); } |
#define | STUB { stub_fatal(STUB_API " required"); } |
macro to stub a void function. More... | |
#define | STUB_NOP { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; } |
#define | STUB_RETVAL(x) { stub_fatal(STUB_API " required"); return x; } |
#define | STUB_RETVAL_NOP(x) { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; return x; } |
#define | STUB_RETREF(x) { stub_fatal(STUB_API " required"); return *(x *)nullptr; } |
#define | STUB_RETSTATREF(x) STUB_RETREF(x) |
Macro Definition Documentation
◆ STUB
#define STUB { stub_fatal(STUB_API " required"); } |
◆ stub_fatal
#define stub_fatal | ( | m | ) | { std::cerr<<"FATAL: "<<(m)<<" for use of "<<__func__<<"\n"; exit(EXIT_FAILURE); } |
\group STUB
A set of useful macros to create stub_* files.
Intended for use building unit tests, if a stubbed function is called by any code it is linked to it will abort with a message indicating which API file is missing from the linked dependencies.
Usage: at the top of your intended stub file define STUB_API to be the name of the .cc file or library you are providing a stub of then include this STUB.h header.
#define STUB_API "foo/libexample.la" #include "tests/STUB.h"
◆ STUB_NOP
#define STUB_NOP { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; } |
◆ STUB_RETREF
#define STUB_RETREF | ( | x | ) | { stub_fatal(STUB_API " required"); return *(x *)nullptr; } |
◆ STUB_RETSTATREF
#define STUB_RETSTATREF | ( | x | ) | STUB_RETREF(x) |
Same as STUB_RETREF(). TODO: Remove
◆ STUB_RETVAL
#define STUB_RETVAL | ( | x | ) | { stub_fatal(STUB_API " required"); return x; } |
◆ STUB_RETVAL_NOP
#define STUB_RETVAL_NOP | ( | x | ) | { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; return x; } |
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products