Remove unused Stringify macro variants 24/240224/1
authorMateusz Cegielka <m.cegielka@samsung.com>
Tue, 4 Aug 2020 11:07:54 +0000 (13:07 +0200)
committerMateusz Cegielka <m.cegielka@samsung.com>
Tue, 4 Aug 2020 11:07:54 +0000 (13:07 +0200)
Stringify is a helper macro used for formatting variadic arguments to a
string in error messages. The code also contains unused StringifyAvoid,
StringifyDebug and StringifyError macros.

I have removed the unused macros and their tests.

Change-Id: I08d00480a2e6ba73ba1a6c573c7afc4fccc36500

src/manager/common/stringify.h
unit-tests/test_stringify.cpp

index c8b32d2..300b1ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2000 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
 #define Stringify(...)                                        \
     (static_cast<std::ostringstream &>(std::ostringstream()   \
         STRINGIFY_(PP_NARG(__VA_ARGS__), __VA_ARGS__))).str()
-
-#define StringifyAvoid(...) std::string()
-#define StringifyError(...) Stringify(__VA_ARGS__)
-
-#ifdef DEBUG
-#define StringifyDebug(...) Stringify(__VA_ARGS__)
-#else
-#define StringifyDebug(...) std::string()
-#endif
index 0fd3727..abf18e2 100644 (file)
 
 BOOST_AUTO_TEST_SUITE(STRINGIFY_TEST)
 
-POSITIVE_TEST_CASE(stringify_default)
+POSITIVE_TEST_CASE(stringify)
 {
        BOOST_REQUIRE(Stringify("a", "b", "c") == "abc");
        BOOST_REQUIRE(Stringify(std::string("a"), "b", "c") == "abc");
        BOOST_REQUIRE(Stringify().empty());
 }
 
-POSITIVE_TEST_CASE(stringify_avoid)
-{
-       BOOST_REQUIRE(StringifyAvoid("a", "b", "c").empty());
-       BOOST_REQUIRE(StringifyAvoid(std::string("a"), "b", "c").empty());
-       BOOST_REQUIRE(StringifyAvoid().empty());
-}
-
-POSITIVE_TEST_CASE(stringify_error)
-{
-       BOOST_REQUIRE(StringifyError("a", "b", "c") == "abc");
-       BOOST_REQUIRE(StringifyError(std::string("a"), "b", "c") == "abc");
-       BOOST_REQUIRE(StringifyError().empty());
-}
-
 BOOST_AUTO_TEST_SUITE_END()