1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix cppcheck warnings

This commit is contained in:
Steffen Vogel 2020-09-11 15:16:53 +02:00
parent 52809061e5
commit 1c9ba6eca2
14 changed files with 22 additions and 8 deletions

View file

@ -101,6 +101,8 @@ protected:
json_t *setting;
json_error_t error;
std::string msg;
public:
template<typename... Args>
ConfigError(json_t *s, const std::string &i, const std::string &what = "Failed to parse configuration") :
@ -143,18 +145,17 @@ public:
virtual const char * what() const noexcept
{
std::stringstream ss;
if (msg.empty()) {
std::stringstream ss;
ss << std::runtime_error::what() << std::endl;
ss << " Please consult the user documentation for details: " << docUri();
ss << std::runtime_error::what() << std::endl;
ss << " Please consult the user documentation for details: " << docUri();
if (error.position >= 0) {
ss << std::endl << " " << error.text << " in " << error.source << ":" << error.line << ":" << error.column;
if (error.position >= 0)
ss << std::endl << " " << error.text << " in " << error.source << ":" << error.line << ":" << error.column;
}
auto str = new std::string(ss.str());
return str->c_str();
return msg.c_str();
}
};

View file

@ -49,6 +49,7 @@ protected:
public:
TableColumn(int w, enum Alignment a, const std::string &t, const std::string &f, const std::string &u = "") :
_width(0),
width(w),
title(t),
format(f),

View file

@ -33,6 +33,7 @@ using namespace villas;
* The Sciebo share is read/write accessible via WebDAV. */
#define BASE_URI "https://1Nrd46fZX8HbggT:badpass@rwth-aachen.sciebo.de/public.php/webdav/node/tests"
// cppcheck-suppress unknownMacro
TestSuite(advio,
.description = "Advanced file IO"
);

View file

@ -28,6 +28,7 @@
using namespace villas::utils::base64;
// cppcheck-suppress unknownMacro
TestSuite(base64, .description = "Base64 En/decoder");
static std::vector<byte> vec(const char *str)

View file

@ -29,6 +29,7 @@
using namespace villas;
// cppcheck-suppress unknownMacro
TestSuite(graph, .description = "Graph library");
Test(graph, basic, .description = "DirectedGraph")

View file

@ -31,6 +31,7 @@ const std::array<double, 10> test_data = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
using namespace villas;
// cppcheck-suppress unknownMacro
TestSuite(hist, .description = "Histogram");
Test(hist, simple) {

View file

@ -32,6 +32,7 @@ using namespace villas;
using villas::JsonBuffer;
// cppcheck-suppress unknownMacro
TestSuite(buffer, .description = "Buffer datastructure");
Test(json_buffer, decode)

View file

@ -26,6 +26,7 @@
using namespace villas::kernel;
// cppcheck-suppress unknownMacro
TestSuite(kernel, .description = "Kernel features");
#if defined(__x86_64__) || defined(__i386__)

View file

@ -37,6 +37,7 @@ struct data {
int data;
};
// cppcheck-suppress unknownMacro
TestSuite(list, .description = "List datastructure");
Test(list, vlist_lookup_name)

View file

@ -27,6 +27,7 @@
using namespace villas::utils;
// cppcheck-suppress unknownMacro
TestSuite(popen, .description = "Bi-directional popen");
Test(popen, no_shell)

View file

@ -27,6 +27,7 @@
#include <villas/task.hpp>
#include <villas/timing.h>
// cppcheck-suppress unknownMacro
TestSuite(task, .description = "Periodic timer tasks");
Test(task, rate, .timeout = 10)

View file

@ -26,6 +26,7 @@
#include <villas/timing.h>
// cppcheck-suppress unknownMacro
TestSuite(timing, .description = "Time measurements");
Test(timing, time_now)

View file

@ -28,6 +28,7 @@
#define CNT (1 << 18)
// cppcheck-suppress unknownMacro
TestSuite(tsc, .description = "Timestamp counters");
Test(tsc, increasing)

View file

@ -30,6 +30,7 @@
using namespace villas::utils;
// cppcheck-suppress unknownMacro
TestSuite(utils, .description = "Utilities");
/* Simple normality test for 1,2,3s intervals */