From 6197daea0be7ffcfa827a53a45b42cbf9e3ee837 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 12 Mar 2019 20:56:20 +0100 Subject: [PATCH] Check for astyle version 3 before formatting the code. Unfortunately, code formatters change their behaviour between versions. The code currently requires astyle version 3.x, so check this before running astyle. If the wrong version is installed, print an error. --- Makefile.am | 1 + test/blackbox/common/network_namespace_framework.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4220d3c8..44a5c818 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,7 @@ ChangeLog: git log > ChangeLog astyle: + @astyle --version | grep -q "Version 3" || (echo 'ERROR: astyle version 3 required!' 1>&2 && exit 1) astyle --options=.astylerc -nQ \ src/*.[ch] \ src/ed25519/e*.[ch] \ diff --git a/test/blackbox/common/network_namespace_framework.c b/test/blackbox/common/network_namespace_framework.c index 2cac3b2e..d72286e9 100644 --- a/test/blackbox/common/network_namespace_framework.c +++ b/test/blackbox/common/network_namespace_framework.c @@ -170,10 +170,12 @@ void netns_connect_namespaces(netns_state_t *test_state, namespace_t *ns1, names } interface->if_name = strdup(if_name); + assert(interface->if_name); // Connect one end of the the veth pair to the namespace's interface assert(sprintf(cmd, "ip link set %s netns %s name %s", eth_pairs[i], ns[i]->name, interface->if_name) >= 0); + assert(system(cmd) == 0); } else { -- 2.39.5