From 07b53a06e9cde268d423917193f1f3d7cebcdbeb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Sep 2017 16:25:29 +0300 Subject: Add macro A_WARN_UNUSED_NON_TESTS what works only not in unit tests. --- src/configuration.h | 11 +++++++---- src/localconsts.h | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index fa3e0ec19..dae353143 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -340,13 +340,16 @@ class Configuration final : public ConfigurationObject * The default value returned in based on fallbacks registry. * @see defaults.h */ - int getIntValue(const std::string &key) const A_WARN_UNUSED; + int getIntValue(const std::string &key) const A_WARN_UNUSED_NON_TESTS; - float getFloatValue(const std::string &key) const A_WARN_UNUSED; + float getFloatValue(const std::string &key) const + A_WARN_UNUSED_NON_TESTS; - std::string getStringValue(const std::string &key) const A_WARN_UNUSED; + std::string getStringValue(const std::string &key) const + A_WARN_UNUSED_NON_TESTS; - bool getBoolValue(const std::string &key) const A_WARN_UNUSED; + bool getBoolValue(const std::string &key) const + A_WARN_UNUSED_NON_TESTS; std::string getDirectory() const noexcept2 A_WARN_UNUSED { return mDirectory; } diff --git a/src/localconsts.h b/src/localconsts.h index 5b53d364c..0f554a677 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -94,6 +94,11 @@ #ifdef __GNUC__ #define A_UNUSED __attribute__ ((unused)) #define A_WARN_UNUSED __attribute__ ((warn_unused_result)) +#ifdef UNITTESTS +#define A_WARN_UNUSED_NON_TESTS +#else // UNITTESTS +#define A_WARN_UNUSED_NON_TESTS __attribute__ ((warn_unused_result)) +#endif // UNITTESTS #define DEPRECATED __attribute__ ((deprecated)) #ifdef DYECMD #define A_DYECMD_UNUSED __attribute__ ((unused)) @@ -165,6 +170,7 @@ #else // __GNUC__ #define A_UNUSED #define A_WARN_UNUSED +#define A_WARN_UNUSED_NON_TESTS #define gnu_printf printf #define DEPRECATED #define restrict -- cgit v1.2.3-60-g2f50