Indent every scope and put opening braces on the signature line
Namespace and extern "C" bodies are indented a level, so nesting is visible from the indentation rather than only from the braces. Opening braces stay on the line that opens the scope, including function definitions, which previously carried theirs on a line of their own.
This commit is contained in:
9
tests/fixtures/src/bad_version.cpp
vendored
9
tests/fixtures/src/bad_version.cpp
vendored
@@ -20,19 +20,16 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
extern "C" const char* dpm_module_version(void)
|
||||
{
|
||||
extern "C" const char* dpm_module_version(void) {
|
||||
return "banana";
|
||||
}
|
||||
|
||||
extern "C" const char* dpm_module_description(void)
|
||||
{
|
||||
extern "C" const char* dpm_module_description(void) {
|
||||
return "Fixture with a malformed version.";
|
||||
}
|
||||
|
||||
extern "C" int dpm_module_execute(void* ctx, const char* command,
|
||||
int argc, char** argv)
|
||||
{
|
||||
int argc, char** argv) {
|
||||
(void)ctx;
|
||||
(void)command;
|
||||
(void)argc;
|
||||
|
||||
9
tests/fixtures/src/good.cpp
vendored
9
tests/fixtures/src/good.cpp
vendored
@@ -24,21 +24,18 @@
|
||||
*/
|
||||
#include <cstring>
|
||||
|
||||
extern "C" const char* dpm_module_version(void)
|
||||
{
|
||||
extern "C" const char* dpm_module_version(void) {
|
||||
return "1.2.3";
|
||||
}
|
||||
|
||||
extern "C" const char* dpm_module_description(void)
|
||||
{
|
||||
extern "C" const char* dpm_module_description(void) {
|
||||
return "Known-good stub module.";
|
||||
}
|
||||
|
||||
/* Answers "ping" with 42 so a dispatch round trip is observable, and
|
||||
0 for anything else. */
|
||||
extern "C" int dpm_module_execute(void* ctx, const char* command,
|
||||
int argc, char** argv)
|
||||
{
|
||||
int argc, char** argv) {
|
||||
(void)ctx;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
6
tests/fixtures/src/missing_symbols.cpp
vendored
6
tests/fixtures/src/missing_symbols.cpp
vendored
@@ -21,12 +21,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
extern "C" const char* dpm_module_version(void)
|
||||
{
|
||||
extern "C" const char* dpm_module_version(void) {
|
||||
return "1.0.0";
|
||||
}
|
||||
|
||||
extern "C" const char* dpm_module_description(void)
|
||||
{
|
||||
extern "C" const char* dpm_module_description(void) {
|
||||
return "Fixture missing most of the contract.";
|
||||
}
|
||||
|
||||
@@ -50,14 +50,12 @@ static int g_checks = 0;
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static bool error_contains(dpm_ctx* ctx, const char* needle)
|
||||
{
|
||||
static bool error_contains(dpm_ctx* ctx, const char* needle) {
|
||||
const char* err = dpm_last_error(ctx);
|
||||
return err != nullptr && std::strstr(err, needle) != nullptr;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int main(void) {
|
||||
/* ---- dpm_open: invalid explicit override refuses ---- */
|
||||
{
|
||||
dpm_open_overrides bad = {"/does/not/exist/conf", nullptr, nullptr, -1};
|
||||
|
||||
Reference in New Issue
Block a user